-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (56 loc) · 1.77 KB
/
build.yaml
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
name: Build
on:
release:
types:
- created
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: --skip-publish --clean
- name: Upload
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
run: |
tag_name="${GITHUB_REF##*/}"
hub release edit $(find dist -type f -name "*.tar.gz" -printf "-a %p ") -a "dist/checksums.txt" -m "" "$tag_name"
- name: Upload Homebrew formula
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
APIS_USERNAME: ${{secrets.APIS_USERNAME}}
APIS_EMAIL: ${{secrets.APIS_EMAIL}}
run: |
git config --global user.email "${APIS_EMAIL}"
git config --global user.name "${APIS_USERNAME}"
tag_name="${GITHUB_REF##*/}"
cd dist
git clone "https://git:${GITHUB_TOKEN}@github.com/strmprivacy/homebrew-cli.git"
cp -f homebrew/Formula/strm.rb homebrew-cli
cd homebrew-cli
git add .
git commit -m "Release brew formula for STRM Privacy CLI ${tag_name}"
git push
git tag -a "${tag_name}" -m "Release brew formula for STRM Privacy CLI ${tag_name}"
git push --tags
- name: Publish Docs
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
APIS_USERNAME: ${{secrets.APIS_USERNAME}}
APIS_EMAIL: ${{secrets.APIS_EMAIL}}
run: |
./scripts/publish_docs.sh