Skip to content

Update nightly.yml

Update nightly.yml #5

Workflow file for this run

name: Nightly
on:
push:
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
prepare:
name: Compute tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Derive tag from commit SHA
id: tag
run: echo "tag=nightly-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
build:
name: Build (${{ matrix.rid }})
needs: prepare
strategy:
fail-fast: false
matrix:
include:
- runner: windows-latest
rid: win-x64
- runner: ubuntu-latest
rid: linux-x64
- runner: macos-latest
rid: osx-arm64
- runner: macos-latest
rid: osx-x64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install build tools (linux-x64)
if: matrix.rid == 'linux-x64'
run: |
sudo apt-get update -q
sudo apt-get install -y clang zlib1g-dev
- name: Publish
run: >
dotnet publish Shark.csproj
-c Release
-r ${{ matrix.rid }}
--self-contained
-o out
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: Shark-${{ matrix.rid }}
path: out/
retention-days: 1
release:
name: Publish release
needs: [prepare, build]
runs-on: ubuntu-latest
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Zip each platform directory
run: |
mkdir zips
for dir in dist/*/; do
name=$(basename "$dir")
(cd "$dir" && zip -r "../../zips/${name}.zip" .)
done
- name: Create draft release and upload assets
id: create_draft
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.tag }}
name: "Nightly - ${{ needs.prepare.outputs.tag }}"
body: |
Automated nightly build.
Commit: ${{ github.sha }}
Branch: ${{ github.ref_name }}
prerelease: true
draft: true
files: zips/*.zip
- name: Publish draft release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.tag }}
draft: false
prerelease: true