-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 2.76 KB
/
create-release.yaml
File metadata and controls
95 lines (83 loc) · 2.76 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
build-and-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [arm64, amd64]
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Build
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v -ldflags "-X github.com/xbglowx/github-org-repos-sync/cmd.Version=${{ needs.release-please.outputs.tag_name }}" -o github-org-repos-sync-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: github-org-repos-sync-${{ matrix.goos }}-${{ matrix.goarch }}
path: ./github-org-repos-sync-${{ matrix.goos }}-${{ matrix.goarch }}
release-assets:
needs: [release-please, build-and-publish]
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Prep binaries
run: |
mkdir tmp
find artifacts -type f -name "github-org-repos-sync-*" -exec mv {} tmp/ \;
- name: Generate SHA256 Checksum
run: |
cd tmp
shasum -a 256 github-org-repos-sync-* > sha256sums.txt
- name: Upload artifacts to existing release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: |
./tmp/sha256sums.txt
./tmp/github-org-repos-sync-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-homebrew:
needs: [release-please, release-assets]
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- name: Update Homebrew formula
uses: mislav/bump-homebrew-formula-action@v4.1
with:
formula-name: github-org-repos-sync
homebrew-tap: xbglowx/homebrew-tap
tag-name: ${{ needs.release-please.outputs.tag_name }}
commit-message: |
chore: update {{formulaName}} to {{version}}
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}