Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release

on:
release:
types: [published]

jobs:
build-and-upload:
name: Build ${{ matrix.artifact_os }} ${{ matrix.artifact_arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
artifact_os: Linux
artifact_arch: x86_64
runner: ubuntu-latest
- goos: linux
goarch: arm64
artifact_os: Linux
artifact_arch: aarch64
runner: ubuntu-latest
- goos: darwin
goarch: amd64
artifact_os: Darwin
artifact_arch: x86_64
runner: ubuntu-latest
- goos: darwin
goarch: arm64
artifact_os: Darwin
artifact_arch: arm64
runner: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Download dependencies
run: go mod download

- name: Build
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p dist
go build -o dist/envmap .

- name: Create archive
run: |
tar -C dist -czf envmap_${{ matrix.artifact_os }}_${{ matrix.artifact_arch }}.tar.gz envmap

- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: envmap_${{ matrix.artifact_os }}_${{ matrix.artifact_arch }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading