-
Notifications
You must be signed in to change notification settings - Fork 14
179 lines (170 loc) · 5.6 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Release
on:
push:
branches: [release]
pull_request:
branches: [release]
env:
CARGO_TERM_COLOR: always
jobs:
release-linux-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.51.0
# cache cargo
- uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: GTK development librarys
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libgtksourceview-3.0-dev
- name: build
run: cargo build --release --all-features
- name: rename output
run: mv target/release/boop-gtk ./boop-gtk.linux.amd64
- uses: actions/[email protected]
with:
name: boop-gtk.linux.amd64
path: ./boop-gtk.linux.amd64
release-snap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- uses: snapcore/action-build@v1
id: snapcraft
- uses: snapcore/[email protected]
if: github.event_name != 'pull_request'
continue-on-error: true # don't fail if a manual review is required (etc)
with:
store_login: ${{ secrets.snapcraft_token }}
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
- name: rename output
run: mv ${{ steps.snapcraft.outputs.snap }} ./boop-gtk.snap
- uses: actions/[email protected]
with:
name: boop-gtk.snap
path: ./boop-gtk.snap
release-flatpak:
runs-on: ubuntu-latest
container:
image: docker.io/bilelmoussaoui/flatpak-github-actions
options: --privileged
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Dependency (Python TOML)
run: sudo dnf install -y python3-toml
- name: Generate sources
run: bash gen-sources.sh
- uses: bilelmoussaoui/flatpak-github-actions@v3
with:
bundle: "boop-gtk.flatpak"
manifest-path: "flatpak/fyi.zoey.Boop-GTK.json"
- uses: actions/[email protected]
with:
name: boop-gtk.flatpak
path: ./boop-gtk.flatpak
release-cargo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.51.0
# cache cargo
- uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: GTK development librarys
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libgtksourceview-3.0-dev
- name: cargo login
if: github.event_name != 'pull_request'
run: cargo login ${{ secrets.CRATES }}
- name: cargo publish
if: github.event_name != 'pull_request'
run: cargo publish
- name: cargo publish (dry run)
if: github.event_name == 'pull_request'
run: cargo publish --dry-run
release:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' # don't do a release for pull requests into release, just upload artifacts to test
needs:
[
release-linux-amd64,
release-snap,
release-flatpak,
]
steps:
# download artifacts
- uses: actions/download-artifact@v2
with:
name: boop-gtk.linux.amd64
path: ./
- uses: actions/download-artifact@v2
with:
name: boop-gtk.snap
path: ./
- uses: actions/download-artifact@v2
with:
name: boop-gtk.flatpak
path: ./
# create a release
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
# upload
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./boop-gtk.linux.amd64
asset_name: boop-gtk.linux.amd64
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./boop-gtk.snap
asset_name: boop-gtk.snap
asset_content_type: application/octet-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./boop-gtk.flatpak
asset_name: boop-gtk.flatpak
asset_content_type: application/octet-stream