-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.47 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: Create Release
on:
push:
tags:
- "v*" # Triggers on tags starting with 'v'
permissions:
contents: write
jobs:
build-and-release-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Setup Certificate
env:
CODE_SIGN_CERTIFICATE: ${{ secrets.CODE_SIGN_CERTIFICATE }}
CERT_PWD: ${{ secrets.CERT_PWD }}
run: |
echo "$CODE_SIGN_CERTIFICATE" | base64 --decode > certificate.p12
stat -f "%N %z" certificate.p12
security create-keychain -p "" build.keychain
security default-keychain -d user -s build.keychain
security unlock-keychain -p "" build.keychain
security import certificate.p12 -k build.keychain -P "$CERT_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain
- name: Build bundle
run: make bundle-mac
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
dist/MineSweeper.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-and-release-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Download linuxdeploy
run: |
wget -nv -c https://github.com/linuxdeploy/linuxdeploy/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
mkdir -p ~/.local/bin
mv linuxdeploy-x86_64.AppImage ~/.local/bin
sudo add-apt-repository universe
sudo apt install libfuse2t64
- name: Build bundle
run: |
export PATH=$HOME/.local/bin:$PATH
make linux-app-image
- name: Build debian package
run: |
cargo install cargo-deb
make linux-debian
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
MineSweeper-x86_64.AppImage
target/debian/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}