Release #11
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-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-basic: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: node | |
- target: static | |
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 app | |
run: deno task build | |
env: | |
BUILD_TARGET: ${{ matrix.target }} | |
- name: Release build assets | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
run: | | |
cp LICENSE build/LICENSE | |
zip -r headnet-${{ matrix.target }}-${{ github.event.release.tag_name }}.zip build | |
gh release upload ${{ github.event.release.tag_name }} headnet-${{ matrix.target }}-${{ github.event.release.tag_name }}.zip | |
build-tauri: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- tag: darwin-aarch64 | |
platform: 'macos-latest' # for Arm based macs (M1 and above). | |
args: '--target aarch64-apple-darwin' | |
- tag: darwin-x86_64 | |
platform: 'macos-latest' # for Intel based macs. | |
args: '--target x86_64-apple-darwin' | |
- tag: linux-x86_64 | |
platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04. | |
args: '' | |
- tag: windows-x86_64 | |
platform: 'windows-latest' | |
args: '' | |
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 | |
working-directory: ${{ github.workspace }} | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
run: | | |
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 |