-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.44 KB
/
release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: release
defaults:
run:
shell: bash
on:
push:
branches:
- master
- feature/*
tags:
- v*
env:
REGISTRY: ghcr.io
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout...
uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: Setup go...
uses: actions/setup-go@v3
with:
go-version: '^1.20.6'
- name: branch name
id: branch_name
run: |-
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: setup release environment
run: |-
echo -e "HOMEBREW_TAP_TOKEN=${{secrets.ACCESS_TOKEN}}\nGITHUB_TOKEN=${{secrets.ACCESS_TOKEN}}\nLASTFM_KEY=${{secrets.LASTFM_KEY}}\nLASTFM_SECRET=${{secrets.LASTFM_SECRET}}\nSPOTIFY_CLIENT_ID=${{secrets.SPOTIFY_CLIENT_ID}}" >> .release-env
- if: github.ref == 'refs/heads/master' || startsWith(github.ref,'refs/heads/feature/')
name: release dry-run GORELEASER_SKIP_VALIDATE=true
run: |-
make release-dry-run GORELEASER_SKIP_VALIDATE=true
make scoop-config-gen
# - if: startsWith(github.ref,'refs/tags/v')
# name: release dry-run
# run: |-
# make release-dry-run
# env:
# RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }}
- if: startsWith(github.ref,'refs/tags/v') && github.repository == 'go-musicfox/spotifox'
name: release publish
run: |-
sudo rm -rf dist
make release
env:
RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }}
- if: startsWith(github.ref,'refs/tags/v') && github.repository == 'go-musicfox/spotifox'
name: Generate scoop config and commit
run: |-
make scoop-config-gen
git config --global user.email "[email protected]"
git config --global user.name "anhoder"
git add .
git commit -m "feat: update scoop config" || true
- if: startsWith(github.ref,'refs/tags/v') && github.repository == 'go-musicfox/spotifox'
name: Push scoop config
uses: ad-m/github-push-action@master
with:
github_token: ${{secrets.ACCESS_TOKEN}}
branch: master