Skip to content

Nightly Release

Nightly Release #91

Workflow file for this run

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