generated from geng-engine/geng_template
-
Notifications
You must be signed in to change notification settings - Fork 2
148 lines (142 loc) · 4.43 KB
/
deploy.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
name: Deploy
on: push
permissions:
contents: write
jobs:
build-web:
name: Build (Web)
runs-on: ubuntu-latest
container: ghcr.io/geng-engine/cargo-geng
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- run: cargo geng build --release --platform web
env:
LEADERBOARD_URL: ${{ secrets.LEADERBOARD_URL }}
LEADERBOARD_KEY: ${{ secrets.LEADERBOARD_KEY }}
- name: Upload artifacts (web)
uses: actions/upload-artifact@v4
with:
name: web
path: target/geng
build-native:
name: Build (Native)
runs-on: ${{ matrix.platform.runs-on }}
strategy:
matrix:
platform:
- runs-on: ubuntu-latest
channel: linux
- runs-on: macos-latest
channel: mac
- runs-on: windows-latest
channel: windows
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install things
if: matrix.platform.channel == 'linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install cargo-geng
run: cargo install cargo-geng --git https://github.com/geng-engine/cargo-geng --rev b2655fd973409f990e7967b37ce8a349b44eda31
- name: Build
uses: actions-rs/cargo@v1
with:
command: geng
args: build --release
env:
LEADERBOARD_URL: ${{ secrets.LEADERBOARD_URL }}
LEADERBOARD_KEY: ${{ secrets.LEADERBOARD_KEY }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.channel }}
path: target/geng
deploy-pages:
name: Deploy Github Pages
if: github.ref == 'refs/heads/main' && github.repository_owner == 'nertsal'
runs-on: ubuntu-latest
needs:
- build-web
permissions:
contents: write
environment:
name: main
url: https://nertsal.github.io/close-to-light
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Deploy GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: web
deploy-pages-dev:
name: Deploy Github Pages (dev)
if: github.ref == 'refs/heads/dev' && github.repository_owner == 'nertsal'
runs-on: ubuntu-latest
needs:
- build-web
permissions:
contents: write
environment:
name: dev
url: https://nertsal.github.io/close-to-light/dev
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Deploy GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: web
destination_dir: dev
deploy-itch:
name: Deploy Itch
if: github.ref == 'refs/heads/main' && github.repository_owner == 'nertsal'
runs-on: ubuntu-latest
needs:
- build-web
- build-native
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Upload itch.io (Web)
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: html5
ITCH_GAME: close-to-light
ITCH_USER: nertsal
PACKAGE: web
- name: Upload itch.io (Windows)
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: windows
ITCH_GAME: close-to-light
ITCH_USER: nertsal
PACKAGE: windows
- name: Upload itch.io (Linux)
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux
ITCH_GAME: close-to-light
ITCH_USER: nertsal
PACKAGE: linux
- name: Upload itch.io (MacOS)
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: mac
ITCH_GAME: close-to-light
ITCH_USER: nertsal
PACKAGE: mac