release #127
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: | |
| workflow_run: | |
| workflows: ['CI'] | |
| types: | |
| - completed | |
| branches: | |
| - master | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| set-version: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.head_branch == 'master' && github.event.workflow_run.conclusion == 'success' }} | |
| container: | |
| image: mcr.microsoft.com/dotnet/sdk:6.0 | |
| outputs: | |
| semVer: ${{ steps.gitversion.outputs.semVer }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: install deps | |
| run: | | |
| apt-get update && apt-get install -y jq git | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config user.email ${{ github.actor }}[email protected] | |
| git config user.name ${{ github.actor }} | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| versionSpec: '5.x' | |
| - name: Set SemVer Version | |
| uses: gittools/actions/gitversion/[email protected] | |
| id: gitversion | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: set-version | |
| env: | |
| SEMVER: ${{ needs.set-version.outputs.semVer }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install Eirctl | |
| uses: ensono/actions/[email protected] | |
| with: | |
| version: 0.7.6 | |
| isPrerelease: false | |
| - name: build binary | |
| run: | | |
| VERSION=${SEMVER} REVISION=$GITHUB_SHA eirctl run pipeline build:bin | |
| - name: Release binary | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.set-version.outputs.semVer }} | |
| # TODO: add additional info to the release | |
| generate_release_notes: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| files: ./dist/* | |
| prerelease: false | |
| - name: release library | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config user.email ${{ github.actor }}[email protected] | |
| git config user.name ${{ github.actor }} | |
| VERSION=${SEMVER} REVISION=$GITHUB_SHA eirctl run tag |