Nightly Build #13
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
#It probably sucks but I want to try | |
name: Nightly Build | |
on: | |
schedule: | |
# Fire every day at 22:00pm UTC | |
- cron: "0 22 * * *" | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --release | |
- name: Archive Binaries | |
run: | | |
mkdir -p artifacts | |
cp target/release/CrabMC artifacts/CrabMC-linux | |
tar -czf artifacts/CrabMC-linux.tar.gz -C artifacts CrabMC-linux | |
- name: Upload Binaries as Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-binaries | |
path: artifacts/CrabMC-linux.tar.gz | |
build-macos: | |
runs-on: macos-latest | |
needs: build-linux | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --release | |
- name: Archive Binaries | |
run: | | |
mkdir -p artifacts | |
cp target/release/CrabMC artifacts/CrabMC-macos | |
tar -czf artifacts/CrabMC-macos.tar.gz -C artifacts CrabMC-macos | |
- name: Upload Binaries as Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-binaries | |
path: artifacts/CrabMC-macos.tar.gz | |
build-windows: | |
runs-on: windows-latest | |
needs: build-linux | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --release | |
- name: Archive Binaries | |
run: | | |
mkdir -p artifacts | |
cp target/release/CrabMC.exe artifacts/CrabMC.exe | |
- name: Upload Binaries as Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-binaries | |
path: artifacts/CrabMC.exe | |
release: | |
runs-on: ubuntu-latest | |
needs: [build-linux, build-macos, build-windows] | |
permissions: | |
contents: write | |
id-token: write | |
actions: write | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Create Draft Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: nightly-${{ env.DATE }} | |
release_name: Nightly ${{ env.DATE }} | |
body: | | |
This is the nightly release of CrabMC from the night of ${{ env.DATE }}. | |
Enjoy the latest features! | |
THE SOFTWARE IS NOT READY FOR PRODUCTION USE! | |
THIS SOFTWARE IS EXPERIMENTAL! | |
THIS SOFTWARE IS PROVIDED "AS IS"! | |
THIS SOFTWARE IS WRITTEN BY A RUST NEWBIE! | |
But if you want, you can check the source code to make up your own mind about whether it is safe to run on your machine. | |
Linux and macOS tip: You need to run the file in `sudo` mode because it can't write files like eula.txt and logs otherwise. | |
Important macOS tip: If your system tells you that the file can't be executed because it can't check if it is a virus or not, you need to go to your security settings and allow the program to run. After that it will say that it is dangerous to run the program, but run it and you will see. | |
draft: false | |
prerelease: false | |
- name: Debug Upload URL | |
run: echo "Upload URL ${{ steps.create_release.outputs.upload_url }}" | |
- name: Download Linux Binaries from Build Job | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux-binaries | |
path: ./linux-binaries | |
- name: Download macOS Binaries from Build Job | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-binaries | |
path: ./macos-binaries | |
- name: Download Windows Binaries from Build Job | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-binaries | |
path: ./windows-binaries | |
- name: Upload Linux Binary to Release | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./linux-binaries/CrabMC-linux.tar.gz | |
asset_name: CrabMC-linux.tar.gz | |
asset_content_type: application/gzip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload macOS Binary to Release | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./macos-binaries/CrabMC-macos.tar.gz | |
asset_name: CrabMC-macos.tar.gz | |
asset_content_type: application/gzip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Windows Binary to Release | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./windows-binaries/CrabMC.exe | |
asset_name: CrabMC.exe | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |