replace gocd pipeline with gha pipeline - TERM variable #8
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| jobs: | |
| verify_version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| /bin/bash -c "./tasks verify_version" | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| repo_dir=$PWD | |
| # install bats | |
| sudo git clone https://github.com/bats-core/bats-core /opt/bats-core | |
| sudo git clone https://github.com/bats-core/bats-assert /opt/bats-assert | |
| sudo git clone https://github.com/bats-core/bats-support /opt/bats-support | |
| cd /opt/bats-core && sudo ./install.sh /usr/local | |
| # set up git | |
| git config --global init.defaultBranch main | |
| git config --global user.name xmik | |
| # for docker containers | |
| export TERM=xterm | |
| cd $repo_dir | |
| /bin/bash -c "./tasks test" | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [verify_version, test] | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| /bin/bash -c "./tasks release" | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: [release] | |
| environment: test | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
| run: | | |
| /bin/bash -c "./tasks publish" |