release #93
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: release | |
on: | |
workflow_run: | |
workflows: ['CI'] | |
types: | |
- completed | |
jobs: | |
set-version: | |
runs-on: ubuntu-latest | |
if: ${{ 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 }}-ci@gha.org | |
git config user.name ${{ github.actor }} | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v1.1.1 | |
with: | |
versionSpec: '5.x' | |
- name: Set SemVer Version | |
uses: gittools/actions/gitversion/execute@v1.1.1 | |
id: gitversion | |
- name: echo VERSIONS | |
run: | | |
echo "REVISION -> $GITHUB_SHA" | |
echo "VERSION -> $GITVERSION_SEMVER" | |
release: | |
runs-on: ubuntu-latest | |
container: | |
image: golang:1.21-bullseye | |
env: | |
FOO: Bar | |
needs: set-version | |
env: | |
SEMVER: ${{ needs.set-version.outputs.semVer }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: install deps | |
run: | | |
apt-get update && apt-get install jq git -y | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
git config user.email ${{ github.actor }}-ci@gha.org | |
git config user.name ${{ github.actor }} | |
- name: release library | |
run: | | |
make GIT_TAG=${SEMVER} REVISION=$GITHUB_SHA tag | |
- name: release binary | |
run: | | |
make REVISION=$GITHUB_SHA GIT_TAG=${SEMVER} PAT=${{ secrets.GITHUB_TOKEN }} cross-build | |
make REVISION=$GITHUB_SHA GIT_TAG=${SEMVER} PAT=${{ secrets.GITHUB_TOKEN }} release |