Refactor to use nauthilus_redis module #14
Workflow file for this run
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 Build | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
name: Release Build on ${{ matrix.goos }} / ${{ matrix.goarch }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux] | |
goarch: [amd64, arm64] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Replace values in main.go | |
run: | | |
sed -i "s|@@gittag@@-@@gitcommit@@|$(echo ${GITHUB_REF#refs/heads/})-${GITHUB_SHA:0:8}|" server/main.go | |
- name: Build project | |
run: | | |
cd server && \ | |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \ | |
go build -mod=vendor -ldflags="-s" -o nauthilus-${{ matrix.goos }}-${{ matrix.goarch }} . | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-binary | |
path: server/nauthilus-${{ matrix.goos }}-${{ matrix.goarch }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
token: ${{ secrets.NAUTHILUS_RELEASE }} | |
files: server/nauthilus-${{ matrix.goos }}-${{ matrix.goarch }} |