Skip to content

release

release #105

Workflow file for this run

name: release
on:
workflow_run:
workflows: ['CI']
types:
- completed
branches:
- master
- main
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
container:
image: golang:1.23-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 Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- 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 }}[email protected]
git config user.name ${{ github.actor }}
- name: release library
run: |
task tag GIT_TAG=${SEMVER} REVISION=$GITHUB_SHA
- name: release binary
run: |
task bin REVISION=$GITHUB_SHA GIT_TAG=${SEMVER}
task release REVISION=$GITHUB_SHA GIT_TAG=${SEMVER} PAT=${{ secrets.GITHUB_TOKEN }}