Merge pull request #138 from threez/openbsd #36
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: | |
push: | |
branches: [master] | |
jobs: | |
goreleaser: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- | |
id: vars | |
run: | | |
goVersion=$(grep '^FROM go' .github/go/Dockerfile | cut -d ' ' -f 2 | cut -d ':' -f 2) | |
echo "go_version=${goVersion}" >> $GITHUB_OUTPUT | |
echo "Using Go version ${goVersion}" | |
- | |
name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.vars.outputs.go_version }} | |
- name: release dry run | |
run: make release-dry-run | |
- uses: go-semantic-release/action@v1 | |
id: semantic | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Git config for tagging | |
if: steps.semantic.outputs.version != '' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
- name: Update tags | |
if: steps.semantic.outputs.version != '' | |
run: | | |
TAG=v${{ steps.semantic.outputs.version }} | |
git push origin :refs/tags/${TAG} | |
git tag -fa ${TAG} -m "release v${{ steps.semantic.outputs.version }}" | |
git push origin ${TAG} | |
- name: setup release environment | |
run: |- | |
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env | |
- name: release publish | |
run: make release |