-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (58 loc) · 1.7 KB
/
publish.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
name: Publish release
run-name: ${{ github.actor }} is publishing ${{ github.ref_name}}
permissions:
contents: write
on:
push:
tags:
- "v*"
jobs:
build_linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install SFML
run: sudo apt-get update && sudo apt-get install -y libsfml-dev
- name: Build
run: cargo build --release
- uses: actions/upload-artifact@v3
with:
name: linux-x64
path: ./target/release/mapgame
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Download SFML
run: Invoke-WebRequest -OutFile sfml.zip https://www.sfml-dev.org/files/SFML-2.5.1-windows-vc15-64-bit.zip
- name: Extract SFML
run: Expand-Archive -DestinationPath . .\sfml.zip
- name: Build
run: cargo build --release
env:
SFML_INCLUDE_DIR: ${{ github.workspace }}\SFML-2.5.1\include
SFML_LIBS_DIR: ${{ github.workspace }}\SFML-2.5.1\lib
- uses: actions/upload-artifact@v3
with:
name: windows-x64
path: ./target/release/mapgame.exe
publish_release:
runs-on: ubuntu-latest
needs:
- build_linux
- build_windows
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: bin
- name: Move artifact files
run: |
mv bin/linux-x64/mapgame mapgame-linux-x64
mv bin/windows-x64/mapgame.exe mapgame-windows-x64.exe
- name: Publish release
uses: softprops/action-gh-release@v1
with:
files: |
mapgame-linux-x64
mapgame-windows-x64.exe