-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2 KB
/
build-and-release.yml
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: Build and Release
on:
push:
tags:
- "*"
jobs:
build:
strategy:
matrix:
platform: [macos-arm64, macos-amd64, linux-amd64]
runs-on: macos-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "stable"
- uses: actions/checkout@v4
- run: make ${{ matrix.platform }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}
path: dist/fj_cli-${{ matrix.platform }}
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload-sh:
runs-on: ubuntu-latest
needs: [build, create-release]
steps:
- uses: actions/checkout@main
- uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: fj.sh
asset_name: fj.sh
asset_content_type: application/octet-stream
upload-bin:
runs-on: ubuntu-latest
needs: [build, create-release]
strategy:
matrix:
platform: [macos-arm64, macos-amd64, linux-amd64]
steps:
- uses: actions/download-artifact@main
with:
name: ${{ matrix.platform }}
path: ${{ matrix.platform }}
- uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ matrix.platform }}/fj_cli-${{ matrix.platform }}
asset_name: fj_cli-${{ matrix.platform }}
asset_content_type: application/octet-stream