-
-
Notifications
You must be signed in to change notification settings - Fork 27
169 lines (148 loc) · 5.32 KB
/
rust_parallel_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
on:
push:
tags: v[0-9].[0-9]+.[0-9]+
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always
name: Create release
jobs:
get_version:
name: Get version from Git tag
runs-on: ubuntu-latest
outputs:
project_version: ${{ env.VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Getting version
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
create_release:
name: Create Release
runs-on: ubuntu-latest
needs: get_version
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.get_version.outputs.project_version }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
body: |
## New
* Added new features.
## Bug Fixes & Improvements
* Various fixes and stability improvements.
## Documentation & others
* Updated documentation.
draft: true
prerelease: false
linux-nogui:
name: Create and upload builds
needs: [ create_release, get_version ]
runs-on: ubuntu-latest
strategy:
matrix:
arch: [ amd64, i686, mips, mipsel, armhf, armlf, arm64 ]
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install dependencies
run: |
sudo apt update && sudo apt upgrade && sudo apt install libwebkit2gtk-4.0-dev upx
cargo install cross
- name: Build and package deb packages
run: PKGARCH=${{ matrix.arch }} contrib/deb/generate.sh
- name: Upload bins & debs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${{ needs.get_version.outputs.project_version }}"
ls -lh ./bin/
gh release upload "$tag_name" ./bin/alfis-* --clobber
gh release upload "$tag_name" *.deb --clobber
build-and-upload-gui-zips:
name: Create and upload builds
needs: [ create_release, get_version ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest, macOS-latest ]
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install dependencies
if: contains(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install --no-install-recommends libwebkit2gtk-4.0-dev upx
- name: Build release binaries
run: cargo build --release
- name: Build Windows release binaries with Edge web-engine
if: contains(matrix.os, 'windows')
run: cargo build --release --features "edge" --target-dir edge
- name: windows
if: contains(matrix.os, 'windows')
run: |
echo "BIN_ARCH=windows-amd64" >> $GITHUB_ENV
echo "BIN_ARCH_EDGE=windows-amd64-edge" >> $GITHUB_ENV
- name: linux
if: contains(matrix.os, 'ubuntu')
run: echo "BIN_ARCH=linux-amd64" >> $GITHUB_ENV
- name: macos
if: contains(matrix.os, 'mac')
run: echo "BIN_ARCH=darwin-amd64" >> $GITHUB_ENV
- name: Fill variables
run: |
echo "BIN_PATH=./target/release/alfis" >> $GITHUB_ENV
echo "ZIP_NAME=alfis-${{env.BIN_ARCH}}-${{ needs.get_version.outputs.project_version }}.zip" >> $GITHUB_ENV
- name: Windows variables
if: contains(matrix.os, 'windows')
run: |
echo "BIN_PATH=target/release/alfis.exe" >> $GITHUB_ENV
echo "ZIP_NAME=alfis-${{env.BIN_ARCH}}-${{ needs.get_version.outputs.project_version }}.zip" >> $GITHUB_ENV
echo "BIN_PATH_EDGE=edge/release/alfis.exe" >> $GITHUB_ENV
echo "ZIP_NAME_EDGE=alfis-${{env.BIN_ARCH}}-${{ needs.get_version.outputs.project_version }}-edge.zip" >> $GITHUB_ENV
- name: Packaging
uses: papeloto/action-zip@v1
with:
files: ${{ env.BIN_PATH }} alfis.toml README.md LICENSE adblock.txt
dest: ${{ env.ZIP_NAME }}
- name: Packaging Edge binary
if: contains(matrix.os, 'windows')
uses: papeloto/action-zip@v1
with:
files: ${{ env.BIN_PATH_EDGE }} alfis.toml README.md LICENSE adblock.txt
dest: ${{ env.ZIP_NAME_EDGE }}
- name: Upload zip
id: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.ZIP_NAME }}
asset_name: ${{ env.ZIP_NAME }}
asset_content_type: application/zip
- name: Upload Edge binary
if: contains(matrix.os, 'windows')
id: upload-edge-binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.ZIP_NAME_EDGE }}
asset_name: ${{ env.ZIP_NAME_EDGE }}
asset_content_type: application/zip