Release #9
Workflow file for this run
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: Release | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build-static: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: deno install | |
- name: Patch version | |
run: npm version ${{ github.event.release.tag_name }} --no-commit-hooks --no-git-tag-version | |
- name: Build static app | |
run: deno task build | |
env: | |
BUILD_TARGET: static | |
- name: Release build assets | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
run: | | |
cd ${{github.workspace}} | |
cp LICENSE build/LICENSE | |
zip -r headnet-static-${{ github.event.release.tag_name }}.zip build | |
gh release upload ${{ github.event.release.tag_name }} headnet-static-${{ github.event.release.tag_name }}.zip | |
build-node: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: deno install | |
- name: Patch version | |
run: npm version ${{ github.event.release.tag_name }} --no-commit-hooks --no-git-tag-version | |
- name: Build node app | |
run: deno task build | |
- name: Release build assets | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
run: | | |
cd ${{github.workspace}} | |
cp LICENSE build/LICENSE | |
zip -r headnet-node-${{ github.event.release.tag_name }}.zip build | |
gh release upload ${{ github.event.release.tag_name }} headnet-node-${{ github.event.release.tag_name }}.zip | |
build-docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: deno install | |
- name: Patch version | |
run: npm version ${{ github.event.release.tag_name }} --no-commit-hooks --no-git-tag-version | |
- name: Build app | |
run: deno task build | |
- name: Build versioned docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: ghcr.io/rickli-cloud/headnet:${{ github.event.release.tag_name }} | |
push: true | |
- name: Build latest docker image | |
uses: docker/build-push-action@v5 | |
if: '!github.event.release.prerelease' | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: ghcr.io/rickli-cloud/headnet:latest | |
push: true | |
build-tauri: | |
permissions: | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: 'macos-latest' # for Arm based macs (M1 and above). | |
args: '--target aarch64-apple-darwin' | |
tag: darwin-aarch64 | |
- platform: 'macos-latest' # for Intel based macs. | |
args: '--target x86_64-apple-darwin' | |
tag: darwin-x86_64 | |
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04. | |
args: '' | |
tag: linux-x86_64 | |
- platform: 'windows-latest' | |
args: '' | |
tag: windows-x86_64 | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Setup deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. | |
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: install frontend dependencies | |
run: deno install | |
- name: Patch version | |
run: npm version ${{ github.event.release.tag_name }} --no-commit-hooks --no-git-tag-version | |
- name: Build tauri app | |
uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILD_TARGET: static | |
BASE_PATH: / | |
with: | |
args: ${{ matrix.args }} | |
- name: Release build assets | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
run: | | |
cd ${{github.workspace}} | |
cp LICENSE src-tauri/target/release/LICENSE | |
zip -r headnet-${{ matrix.tag }}-${{ github.event.release.tag_name }}.zip src-tauri/target/release | |
gh release upload ${{ github.event.release.tag_name }} headnet-${{ matrix.tag }}-${{ github.event.release.tag_name }}.zip |