Skip to content

Merge pull request #483 from zoncoen/release #134

Merge pull request #483 from zoncoen/release

Merge pull request #483 from zoncoen/release #134

Workflow file for this run

name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
permissions:
contents: write
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.matrix.outputs.versions }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate matrix
id: matrix
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
versions=$(make matrix)
echo $versions
echo "versions=$versions" >> $GITHUB_OUTPUT
build:
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(needs.matrix.outputs.go-version) }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: GO_VERSION=${{ matrix.go-version }} make build/ci
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.go-version }}
path: ${{ github.workspace }}/dist/
goreleaser:
if: ${{ always() }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: go/src/github.com/${{ github.repository }}
- uses: actions/download-artifact@v4
with:
path: ./go/src/github.com/${{ github.repository }}/dist/
- name: Move artifacts
working-directory: ./go/src/github.com/${{ github.repository }}
run: |
set -eu
mkdir ./assets/
cat ./dist/**/*_checksums.txt > ./assets/checksums.txt
mv ./dist/**/*.tar.gz ./assets/
ls ./assets/
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean -f ./scripts/cross-build/.goreleaser.yml
workdir: ./go/src/github.com/${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}