Skip to content

feat(updater): report pack version in summaries (#69) #34

feat(updater): report pack version in summaries (#69)

feat(updater): report pack version in summaries (#69) #34

Workflow file for this run

name: Release
on:
push:
tags: ["*"]
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- run: go vet ./...
- run: go test ./...
release:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- name: Generate Windows manifest
if: matrix.goos == 'windows'
run: |
go install github.com/akavel/rsrc@v0.10.2
rsrc -manifest gtnh-daily-updater.manifest -arch "${{ matrix.goarch }}" -o "rsrc_windows_${{ matrix.goarch }}.syso"
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
ext=""
if [ "$GOOS" = "windows" ]; then ext=".exe"; fi
go build -ldflags="-s -w -X github.com/caedis/gtnh-daily-updater/cmd.version=${GITHUB_REF_NAME}" -o "gtnh-daily-updater${ext}" .
- name: Package
run: |
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
version="${GITHUB_REF_NAME}"
zip "gtnh-daily-updater-${version}-${{ matrix.goos }}-${{ matrix.goarch }}.zip" "gtnh-daily-updater${ext}"
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: gtnh-daily-updater-${{ matrix.goos }}-${{ matrix.goarch }}
path: "*.zip"
publish:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
with:
generate_release_notes: true
files: gtnh-daily-updater-*