-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (70 loc) · 2.03 KB
/
release.yml
File metadata and controls
77 lines (70 loc) · 2.03 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
name: Release
on:
push:
branches:
- main
concurrency:
group: release
cancel-in-progress: true
run-name: Release by @${{ github.actor }} ${{ github.sha }}
permissions:
contents: write
pull-requests: read
jobs:
get-version:
name: Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Release Version
id: get-version
uses: nullify-platform/github-actions/actions/release-version@main
- run: |
echo "**Version:** ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
build:
if: ${{ needs.get-version.outputs.version != 'undefined' }}
needs: [get-version]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: go build -o slack-cli-${{ matrix.goos }}-${{ matrix.goarch }} .
- uses: actions/upload-artifact@v4
with:
name: slack-cli-${{ matrix.goos }}-${{ matrix.goarch }}
path: slack-cli-${{ matrix.goos }}-${{ matrix.goarch }}
release:
needs: [get-version, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "v${{ needs.get-version.outputs.version }}" artifacts/* --repo ${{ github.repository }} --title "v${{ needs.get-version.outputs.version }}" --generate-notes