Skip to content

Maintance

Maintance #160

Workflow file for this run

name: Release
on:
pull_request: {}
release:
types:
- published
jobs:
version:
name: Verify version
runs-on: ubuntu-latest
outputs:
version: ${{ env.version }}
steps:
- name: Output real version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Output faked version
if: github.event_name == 'pull_request'
run: echo "version=0.0.0" >> $GITHUB_ENV
create-artifacts:
name: Create Artifacts
needs: version
runs-on: ubuntu-latest
strategy:
matrix:
include:
- {GOOS: linux, GOARCH: amd64}
- {GOOS: linux, GOARCH: arm, GOARM: 6}
- {GOOS: linux, GOARCH: arm64}
- {GOOS: darwin, GOARCH: amd64}
- {GOOS: darwin, GOARCH: arm64}
- {GOOS: freebsd, GOARCH: amd64}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make package VERSION='${{ needs.version.outputs.version }}' SUFFIX='-${{ matrix.GOOS }}-${{ matrix.GOARCH }}'
shell: bash
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
GOARM: ${{ matrix.GOARM }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
path: build/lane-*.tar.*
if-no-files-found: error
create-release:
name: Create Release
needs:
- version
- create-artifacts
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: artifacts
- name: Display structure of files
run: ls -Rlah
- name: Attach files
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
tag_name: "${{ needs.version.outputs.version }}"
files: artifacts/*