🐞 fix: Display version #7
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
# SPDX-FileCopyrightText: 2024 Ville Eurométropole Strasbourg | |
# | |
# SPDX-License-Identifier: MIT | |
name: Go | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23.3' | |
- name: Install dependencies | |
run: go get . | |
- name: Build for Linux, Windows and Mac | |
run: | | |
mkdir -p build/linux-amd64 | |
mkdir -p build/windows-amd64 | |
mkdir -p build/mac-amd64 | |
mkdir -p build/mac-arm64 | |
GOOS=linux GOARCH=amd64 go build -o build/linux-amd64/gristctl -ldflags="-X main.version=${GITHUB_REF#refs/tags/}". | |
GOOS=darwin GOARCH=amd64 go build -o build/mac-amd64/gristctl -ldflags="-X main.version=${GITHUB_REF#refs/tags/}". | |
GOOS=darwin GOARCH=arm64 go build -o build/mac-arm64/gristctl -ldflags="-X main.version=${GITHUB_REF#refs/tags/}". | |
GOOS=windows GOARCH=amd64 go build -o build/windows-amd64/gristctl.exe -ldflags="-X main.version=${GITHUB_REF#refs/tags/}". | |
zip -r exec_files.zip build/* | |
tar -cv build/* | gzip > exec_files.tar.gz | |
- name: Archive exec file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gristctl | |
path: build/ | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "exec_files.zip,exec_files.tar.gz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
allowUpdates: true |