ci: updated releaserc with a URL (#151) #729
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
verify: | |
env: | |
GO111MODULE: on | |
runs-on: ubuntu-latest | |
if: "!startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.ref, 'refs/tags/v')" | |
steps: | |
- name: setup extensions | |
uses: actions/checkout@v1 | |
- name: configuring system for go project | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.14 | |
- name: install dependencies | |
run: make install | |
- name: linting | |
run: make lint | |
test: | |
runs-on: ubuntu-latest | |
if: "!startsWith(github.event.head_commit.message, 'chore') && !startsWith(github.ref, 'refs/tags/v')" | |
steps: | |
- name: setup extensions | |
uses: actions/checkout@v1 | |
- name: running unit tests | |
run: make test-cov | |
- name: publishing code coverage report to codeclimate | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | |
chmod +x ./cc-test-reporter | |
./cc-test-reporter before-build | |
build/publishCodeCoverage.sh | |
- name: running integration tests | |
env: | |
SCC_ENV: ${{ secrets.SCC_ENV }} | |
SECURITY_AND_COMPLIANCE_CENTER_API_IAM_PROFILE_ID: ${{ secrets.SCC_IAM_PROFILE_ID }} | |
run: build/testScript.sh | |
release: | |
runs-on: ubuntu-latest | |
needs: [verify, test] | |
if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'chore')" | |
steps: | |
- name: setup extensions | |
uses: actions/checkout@v1 | |
- name: setup nodejs | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: release using semantic-release | |
env: | |
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }} | |
GIT_AUTHOR_NAME: sccdeveloper | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: sccdeveloper | |
GIT_COMMITTER_EMAIL: [email protected] | |
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} | |
run: | | |
pip install --user bumpversion | |
npm install @semantic-release/changelog | |
npm install @semantic-release/exec | |
npm install @semantic-release/git | |
npm install @semantic-release/github | |
rm -rf package.json | |
rm -rf package-lock.json | |
npx semantic-release | |
documentation: | |
env: | |
GO111MODULE: on | |
runs-on: ubuntu-latest | |
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')" | |
steps: | |
- name: setup extensions | |
uses: actions/checkout@v1 | |
- name: configuring system for go project | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- name: generate gopages | |
run: | | |
make docs | |
- name: deploy gopages to gh-pages | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "sccdeveloper" | |
git config --global user.password "${{ secrets.ADMIN_TOKEN }}" | |
cd v5/dist | |
git init | |
git add . | |
git commit -m "Deploy to GitHub pages" | |
git branch -m gh-pages | |
git remote set-url origin [email protected]:IBM/scc-go-sdk.git | |
git push -f origin gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} | |
GIT_AUTHOR_NAME: sccdeveloper | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: sccdeveloper | |
GIT_COMMITTER_EMAIL: [email protected] |