forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 27
154 lines (113 loc) · 3.84 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
on:
push:
tags:
- pktd-v*.*.*
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Set env
run: echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create a release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
automatic_release_tag: ${{ env.RELEASE_NAME }}
linux:
needs: release
runs-on: ubuntu-latest
steps:
- name: Set env
run: echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install packages
run: sudo apt-get install rpm jq bash curl rubygems
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- run: go version
- uses: actions/checkout@v2
- name: Install fpm
run: gem install --no-document fpm
- name: Build binaries
run: /bin/bash -c "source $GITHUB_WORKSPACE/contrib/github-actions/build-linux-packages.sh"
env:
PKT_FAIL_DIRTY: 1
RELEASE_NAME: ${{ env.RELEASE_NAME }}
- uses: actions/upload-artifact@main
with:
path: |
${{ github.workspace }}/${{ env.RELEASE_NAME }}-linux-x86_64.rpm
${{ github.workspace }}/${{ env.RELEASE_NAME }}-linux-amd64.deb
- name: Publish release
run: /bin/bash -c "source $GITHUB_WORKSPACE/contrib/github-actions/release-linux-packages.sh"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ env.RELEASE_NAME }}
macos:
needs: release
runs-on: macos-latest
steps:
- name: Set env
run: echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install packages
run: brew install jq bash curl brew-gem
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- run: go version
- uses: actions/checkout@v2
- name: Install fpm
run: gem install --no-document fpm
- name: Build binaries
run: /bin/bash -c "source $GITHUB_WORKSPACE/contrib/github-actions/build-macos-package.sh"
env:
PKT_FAIL_DIRTY: 1
RELEASE_NAME: ${{ env.RELEASE_NAME }}
- uses: actions/upload-artifact@main
with:
path: |
${{ github.workspace }}/${{ env.RELEASE_NAME }}-mac.pkg
- name: Publish release
run: /bin/bash -c "source $GITHUB_WORKSPACE/contrib/github-actions/release-macos-package.sh"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ env.RELEASE_NAME }}
windows:
needs: release
runs-on: ubuntu-latest
steps:
- name: Set env
run: echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install packages
run: sudo apt-get install rpm jq bash curl zip
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- run: go version
- uses: actions/checkout@v2
- name: Build binaries
run: /bin/bash -c "source $GITHUB_WORKSPACE/contrib/github-actions/build-windows-package.sh"
env:
PKT_FAIL_DIRTY: 1
RELEASE_NAME: ${{ env.RELEASE_NAME }}
- uses: actions/upload-artifact@main
with:
path: |
${{ github.workspace }}/${{ env.RELEASE_NAME }}-win.zip
- name: Publish release
run: /bin/bash -c "source $GITHUB_WORKSPACE/contrib/github-actions/release-windows-package.sh"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ env.RELEASE_NAME }}