attempt to fix tests in gha #15
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: | |
| - '*' | |
| # for the publish job | |
| permissions: | |
| contents: write | |
| 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 | |
| git config --global user.email [email protected] | |
| # for docker containers | |
| export TERM=xterm | |
| cd $repo_dir | |
| /bin/bash -c "./tasks test" | |
| tag_and_publish: | |
| runs-on: ubuntu-latest | |
| needs: [test, verify_version] | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Tag | |
| id: tag | |
| run: | | |
| /bin/bash -c "./tasks release" | |
| echo "tag=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT | |
| - name: Publish | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| repository: kudulab/docker-ops | |
| token: ${{ secrets.MY_GITHUB_TOKEN }} | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| files: src/docker-ops |