-
-
Notifications
You must be signed in to change notification settings - Fork 30
66 lines (56 loc) · 2.25 KB
/
snapshot.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
name: Snapshot
on:
issue_comment:
types: [created, edited]
jobs:
Snapshot:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/snapshot') && github.event.comment.user.login == 'natesales' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get snapshot ID
id: snapshot_id
run: |
echo SNAPSHOT_ID=pathvector_$(git describe --tags "$(git rev-list --tags --max-count=1)" | cut -c2-)-SNAPSHOT-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Add start comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.issue.number }}
body: |
Starting snapshot release [`${{ steps.snapshot_id.outputs.SNAPSHOT_ID }}`](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Install PDF generation dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive-xetex
- run: go generate -x
- run: mv pathvector*.pdf ${{ steps.snapshot_id.outputs.SNAPSHOT_ID }}.pdf
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --snapshot --rm-dist --release-header distrib/snapshot-header.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.snapshot_id.outputs.SNAPSHOT_ID }} snapshot release
path: |
dist/pathvector*.deb
dist/pathvector*.rpm
dist/pathvector*checksums.txt
dist/pathvector*.tar.gz
pathvector*.pdf
- name: Post end comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.issue.number }}
body: |
Finished snapshot release [`${{ steps.snapshot_id.outputs.SNAPSHOT_ID }}`](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})