Nightly Release #540
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --workspace --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.exe DigitalExtinction/ | |
mv target/${{ matrix.target }}/release/de-lobby.exe DigitalExtinction/ | |
mv target/${{ matrix.target }}/release/de-connector.exe DigitalExtinction/ | |
- name: Add Non-Windows Binary | |
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }} | |
run: | | |
mv target/${{ matrix.target }}/release/de DigitalExtinction/ | |
mv target/${{ matrix.target }}/release/de-lobby DigitalExtinction/ | |
mv target/${{ matrix.target }}/release/de-connector DigitalExtinction/ | |
- 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/ssh-agent@v0.7.0 | |
with: | |
ssh-private-key: ${{ secrets.DOWNLOADS_SSH_KEY }} | |
- name: Git clone and push | |
run: | | |
git clone git@github.com:DigitalExtinction/Downloads.git | |
rsync -avh nightly-builds/ Downloads/ | |
cd Downloads | |
git config core.fileMode false | |
git config user.email "martin.indra@mgn.cz" | |
git config user.name "Martin Indra" | |
git status | |
git add . | |
git commit --amend -m "Nightly" | |
git push --force-with-lease origin main |