-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (76 loc) · 2.51 KB
/
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
78
79
80
81
82
83
84
85
86
87
88
89
90
name: goreleaser
on:
push:
# run only against tags
tags:
- "*"
# permissions:
# contents: write
# packages: write
# issues: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
- name: Upload AMD64 DEB artifacts
uses: actions/upload-artifact@v3
with:
name: alpacon_${{ github.ref_name }}_linux_amd64.deb
path: dist/alpacon_${{ github.ref_name }}_linux_amd64.deb
- name: Upload AMD64 RPM artifacts
uses: actions/upload-artifact@v3
with:
name: alpacon_${{ github.ref_name }}_linux_amd64.rpm
path: dist/alpacon_${{ github.ref_name }}_linux_amd64.rpm
packagecloud-deploy:
needs: goreleaser
runs-on: ubuntu-latest
steps:
- name: Download AMD64 DEB Artifacts
uses: actions/download-artifact@v3
with:
name: alpacon_${{ github.ref_name }}_linux_amd64.deb
- name: Download AMD64 RPM Artifacts
uses: actions/download-artifact@v3
with:
name: alpacon_${{ github.ref_name }}_linux_amd64.rpm
- run: ls
- name: Upload AMD64 DEB to PackageCloud
uses: danielmundi/upload-packagecloud@v1
with:
PACKAGE-NAME: alpacon_${{ github.ref_name }}_linux_amd64.deb
PACKAGECLOUD-USERNAME: alpacanetworks
PACKAGECLOUD-REPO: alpacon
PACKAGECLOUD-DISTRIB: any/any
PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
- name: Upload AMD64 RPM to PackageCloud
uses: danielmundi/upload-packagecloud@v1
with:
PACKAGE-NAME: alpacon_${{ github.ref_name }}_linux_amd64.rpm
PACKAGECLOUD-USERNAME: alpacanetworks
PACKAGECLOUD-REPO: alpacon
PACKAGECLOUD-DISTRIB: rpm_any/rpm_any
PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}