Porytiles Nightly Release #4
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: Porytiles Nightly Release | |
on: | |
schedule: | |
- cron: "00 05 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
check-already-built: | |
name: Check if we already built a nightly from this commit SHA | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: octokit/request-action@v2.x | |
id: check_last_run | |
with: | |
route: GET /repos/${{github.repository}}/actions/workflows/nightly_release.yml/runs?per_page=1&status=completed | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: "echo Last nightly build: ${{fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha}}" | |
outputs: | |
last_sha: ${{fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha}} | |
create-release-tag: | |
name: Create a tag for this release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: develop | |
- uses: rickstaa/action-create-tag@v1 | |
id: "tag_create" | |
with: | |
tag: nightly-${{github.sha}} | |
tag_exists_error: false | |
message: "Tag for nightly-${{github.sha}}" | |
nightly-release-linux-amd64: | |
name: Release a nightly statically linked linux-amd64 binary | |
runs-on: ubuntu-latest | |
needs: [create-release-tag] | |
if: needs.check-already-built.outputs.last_sha != github.sha | |
steps: | |
- name: Install Clang+LLVM 16 and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install zlib1g-dev | |
sudo apt-get install libpng-dev | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 16 all | |
clang++-16 --version | |
clang++-16 -v | |
- name: Checkout new Porytiles nightly tag | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly-${{github.sha}} | |
- name: Create release package | |
run: | | |
./script/package.sh linux-amd64 nightly-${{github.sha}} . | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: porytiles-linux-amd64.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
nightly-release-macos-amd64: | |
name: Release a nightly dynamically linked macos-amd64 binary | |
runs-on: macos-latest | |
needs: [create-release-tag] | |
if: needs.check-already-built.outputs.last_sha != github.sha | |
steps: | |
- name: Install Clang+LLVM 16 and dependencies | |
run: | | |
brew update | |
brew install zlib | |
brew install libpng | |
brew install llvm@16 | |
/usr/local/opt/llvm@16/bin/clang++ --version | |
/usr/local/opt/llvm@16/bin/clang++ -v | |
- name: Checkout new Porytiles nightly tag | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly-${{github.sha}} | |
- name: Create release package | |
run: | | |
./script/package.sh macos-amd64 nightly-${{github.sha}} . | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: porytiles-macos-amd64.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
nightly-release-macos-aarch64: | |
name: Release a nightly dynamically linked macos-aarch64 binary | |
runs-on: macos-14 | |
needs: [create-release-tag] | |
if: needs.check-already-built.outputs.last_sha != github.sha | |
steps: | |
- name: Install Clang+LLVM 16 and dependencies | |
run: | | |
brew update | |
brew install zlib | |
brew install libpng | |
brew install llvm@16 | |
/opt/homebrew/opt/llvm@16/bin/clang++ --version | |
/opt/homebrew/opt/llvm@16/bin/clang++ -v | |
- name: Checkout new Porytiles nightly tag | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly-${{github.sha}} | |
- name: Create release package | |
run: | | |
./script/package.sh macos-aarch64 nightly-${{github.sha}} . | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: porytiles-macos-aarch64.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |