-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (76 loc) · 1.99 KB
/
release.yml
File metadata and controls
80 lines (76 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag_name:
description: "Release tag to publish, like v1.0.2"
required: true
type: string
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
- os: windows-latest
goos: windows
goarch: amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Build
shell: bash
run: |
set -euo pipefail
cd "${GITHUB_WORKSPACE}"
mkdir -p dist
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then
ext=".exe"
fi
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o "dist/git-ark-${{ matrix.goos }}-${{ matrix.goarch }}${ext}" ./cmd/git-ark
- uses: actions/upload-artifact@v4
with:
name: git-ark-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Create checksums
shell: bash
run: |
set -euo pipefail
cd dist
sha256sum git-ark-* > SHA256SUMS.txt
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || github.ref_name }}
files: |
dist/git-ark-*
dist/SHA256SUMS.txt
generate_release_notes: true