Skip to content

build: package releases for different operating systems #5

build: package releases for different operating systems

build: package releases for different operating systems #5

Workflow file for this run

name: Package this version
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
permissions:
contents: write
jobs:
prepare:
name: Publish a build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.21.x'
snapshot:
name: Save a snapshot
needs: prepare
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean --skip=publish
artifacts:
name: Share the artifacts
needs: snapshot
runs-on: ubuntu-latest
strategy:
matrix:
target:
- darwin_arm64.tar.gz
- darwin_x86_64.tar.gz
- linux_arm64.tar.gz
- linux_i386.tar.gz
- linux_x86_64.tar.gz
- windows_arm64.zip
- windows_i386.zip
- windows_x86_64.zip
steps:
- run: echo "VERSION=$(git describe --dirty --always --tags)" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v4
with:
name: etime_$VERSION_checksums.txt
path: ./dist/etime_$VERSION_checksums.txt
- uses: actions/upload-artifact@v4
with:
name: etime_$VERSION_${{ matrix.target }}
path: ./dist/etime_$VERSION_${{ matrix.target }}
release:
name: Distribute a release
needs: prepare
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}