-
-
Notifications
You must be signed in to change notification settings - Fork 25
103 lines (87 loc) · 2.85 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
name: Nightly Release
on:
schedule:
- cron: '30 5 * * *'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
dependencies: linux
- os: ubuntu-latest
target: 'x86_64-pc-windows-gnu'
dependencies: windows
- os: macos-latest
target: 'x86_64-apple-darwin'
dependencies: none
- os: macos-latest
target: 'aarch64-apple-darwin'
dependencies: none
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust
name: Setup
with:
name: prd-build
targets: ${{ matrix.target }}
dependencies: ${{ matrix.dependencies }}
- name: Install cargo-auditable
run: cargo install --force cargo-auditable
- name: Set RUSTFLAGS
run: echo "RUSTFLAGS=-C target-feature=+sse3,+avx" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest'
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Prepare Pack
run: |
mkdir DigitalExtinction
mv assets DigitalExtinction/
mv LICENSE DigitalExtinction/LICENSE
mv README.md DigitalExtinction/README.md
- name: Add Windows Binary
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
run: mv target/${{ matrix.target }}/release/de_game.exe DigitalExtinction/de.exe
- name: Add Non-Windows Binary
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }}
run: mv target/${{ matrix.target }}/release/de_game DigitalExtinction/de
- name: Pack
shell: bash
run: |
mkdir -p ${{ matrix.target }}
zip -r ${{ matrix.target }}/nightly.zip DigitalExtinction
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ matrix.target }}/nightly.zip
process:
name: Upload
environment: nightly
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
path: nightly-builds
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DOWNLOADS_SSH_KEY }}
- name: Git clone and push
run: |
git clone [email protected]:DigitalExtinction/Downloads.git
rsync -avh nightly-builds/ Downloads/
cd Downloads
git config core.fileMode false
git config user.email "[email protected]"
git config user.name "Martin Indra"
git status
git add .
git commit --amend -m "Nightly"
git push --force-with-lease origin main