Skip to content

chore: release v1.0.0 #3

chore: release v1.0.0

chore: release v1.0.0 #3

Workflow file for this run

name: Build artifacts
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: Release version (for example v0.3.0)
required: true
type: string
default: v0.0.0
permissions:
contents: read
env:
RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}
WAILS_VERSION: v3.0.0-beta.13
concurrency:
group: build-artifacts-${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}
cancel-in-progress: false
jobs:
prepare:
name: Prepare release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Validate release version
id: version
shell: bash
run: |
if [[ ! "$RELEASE_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "version must match vX.Y.Z" >&2
exit 1
fi
echo "version=${RELEASE_VERSION#v}" >> "$GITHUB_OUTPUT"
macos:
needs: prepare
name: Build macOS ${{ matrix.arch.label }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch:
- {label: x64, goarch: amd64}
- {label: arm64, goarch: arm64}
env:
CGO_ENABLED: 1
CGO_CFLAGS: -mmacosx-version-min=13.0
CGO_LDFLAGS: -mmacosx-version-min=13.0
MACOSX_DEPLOYMENT_TARGET: '13.0'
MACOS_SIGNING_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- uses: pnpm/setup@v2
with:
package-json-file: frontend/package.json
runtime: node@26
cache: true
cache-dependency-path: frontend/pnpm-lock.yaml
install: false
- name: Import macOS signing certificate
uses: apple-actions/import-codesign-certs@v7
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE_P12 }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
- name: Install Wails
run: go install github.com/wailsapp/wails/v3/cmd/wails3@$WAILS_VERSION
- name: Configure notarization
shell: bash
env:
APPLE_API_KEY_P8: ${{ secrets.APPLE_API_KEY_P8 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER_ID: ${{ secrets.APPLE_API_ISSUER_ID }}
run: |
key_file="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
printf '%s' "$APPLE_API_KEY_P8" > "$key_file"
xcrun notarytool store-credentials codeoff-notary \
--key "$key_file" \
--key-id "$APPLE_API_KEY_ID" \
--issuer "$APPLE_API_ISSUER_ID"
rm "$key_file"
- name: Generate release metadata
run: >-
wails3 update build-assets
-name codeoff-server
-binaryname codeoff-server
-config build/config.yml
-dir build
-productversion ${{ needs.prepare.outputs.version }}
- name: Build macOS app
run: wails3 task package ARCH=${{ matrix.arch.goarch }}
- name: Sign and notarize macOS app
run: >-
wails3 tool sign
--input bin/codeoff-server.app
--identity "$MACOS_SIGNING_IDENTITY"
--notarize
--keychain-profile codeoff-notary
- name: Package macOS OTA archive
run: wails3 task darwin:create:ota ARCH=${{ matrix.arch.goarch }}
- name: Package macOS DMG
run: wails3 task darwin:create:dmg
- name: Sign and notarize macOS DMG
run: >-
wails3 tool sign
--input bin/codeoff-server.dmg
--identity "$MACOS_SIGNING_IDENTITY"
--notarize
--keychain-profile codeoff-notary
- name: Name macOS artifact
run: mv bin/codeoff-server.dmg bin/codeoff-server-darwin-${{ matrix.arch.goarch }}.dmg
- name: Upload macOS DMG
uses: actions/upload-artifact@v7
with:
name: installer-macos-${{ matrix.arch.label }}
path: |
bin/codeoff-server-darwin-${{ matrix.arch.goarch }}.dmg
bin/ota-codeoff-server-darwin-${{ matrix.arch.goarch }}.zip
if-no-files-found: error
windows:
needs: prepare
name: Build Windows ${{ matrix.arch.label }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch:
- {label: x64, goarch: amd64}
- {label: arm64, goarch: arm64}
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- uses: pnpm/setup@v2
with:
package-json-file: frontend/package.json
runtime: node@26
cache: true
cache-dependency-path: frontend/pnpm-lock.yaml
install: false
- name: Install Wails
run: go install github.com/wailsapp/wails/v3/cmd/wails3@$env:WAILS_VERSION
- name: Generate release metadata
run: >-
wails3 update build-assets
-name codeoff-server
-binaryname codeoff-server
-config build/config.yml
-dir build
-productversion ${{ needs.prepare.outputs.version }}
- name: Install NSIS
uses: repolevedavaj/install-nsis@v1.2.1
with:
nsis-version: '3.12'
- name: Package Windows installer
run: wails3 task package ARCH=${{ matrix.arch.goarch }}
- name: Upload Windows installer
uses: actions/upload-artifact@v7
with:
name: installer-windows-${{ matrix.arch.label }}
path: |
bin/codeoff-server-${{ matrix.arch.goarch }}-installer.exe
bin/ota-codeoff-server-windows-${{ matrix.arch.goarch }}.zip
if-no-files-found: error
linux:
needs: prepare
name: Build Linux ${{ matrix.arch.label }}
runs-on: ${{ matrix.arch.runner }}
strategy:
fail-fast: false
matrix:
arch:
- {label: x64, goarch: amd64, runner: ubuntu-24.04}
- {label: arm64, goarch: arm64, runner: ubuntu-24.04-arm}
env:
CGO_ENABLED: 1
GIT_COMMITTER_EMAIL: support@maimory.ai
GIT_COMMITTER_NAME: MaimoryLab
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- uses: pnpm/setup@v2
with:
package-json-file: frontend/package.json
runtime: node@26
cache: true
cache-dependency-path: frontend/pnpm-lock.yaml
install: false
- name: Install GTK4 build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
libgtk-4-dev \
libwebkitgtk-6.0-dev
- name: Install Wails
run: go install github.com/wailsapp/wails/v3/cmd/wails3@$WAILS_VERSION
- name: Package Linux artifacts
run: >-
wails3 task package
ARCH=${{ matrix.arch.goarch }}
VERSION=${{ needs.prepare.outputs.version }}
PACKAGE_NAME=codeoff-server-linux-${{ matrix.arch.goarch }}
- name: Upload Linux packages
uses: actions/upload-artifact@v7
with:
name: installer-linux-${{ matrix.arch.label }}
path: |
bin/codeoff-server-linux-${{ matrix.arch.goarch }}.deb
bin/codeoff-server-linux-${{ matrix.arch.goarch }}.rpm
bin/codeoff-server-linux-${{ matrix.arch.goarch }}.pkg.tar.zst
bin/ota-codeoff-server-linux-${{ matrix.arch.goarch }}.zip
if-no-files-found: error
release:
needs: [macos, windows, linux]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
name: Publish release
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
steps:
- name: Download release artifacts
uses: actions/download-artifact@v8
with:
pattern: installer-*
path: release-assets
merge-multiple: true
- name: Validate and publish release
shell: bash
run: |
expected=(
codeoff-server-darwin-amd64.dmg
codeoff-server-darwin-arm64.dmg
codeoff-server-amd64-installer.exe
codeoff-server-arm64-installer.exe
codeoff-server-linux-amd64.deb
codeoff-server-linux-arm64.deb
codeoff-server-linux-amd64.rpm
codeoff-server-linux-arm64.rpm
codeoff-server-linux-amd64.pkg.tar.zst
codeoff-server-linux-arm64.pkg.tar.zst
ota-codeoff-server-darwin-amd64.zip
ota-codeoff-server-darwin-arm64.zip
ota-codeoff-server-windows-amd64.zip
ota-codeoff-server-windows-arm64.zip
ota-codeoff-server-linux-amd64.zip
ota-codeoff-server-linux-arm64.zip
)
mapfile -t assets < <(find release-assets -maxdepth 1 -type f -printf '%f\n' | sort)
diff <(printf '%s\n' "${expected[@]}" | sort) <(printf '%s\n' "${assets[@]}")
(cd release-assets && sha256sum * > SHA256SUMS)
if gh release view "$RELEASE_VERSION" >/dev/null 2>&1; then
gh release upload "$RELEASE_VERSION" release-assets/* --clobber
gh release edit "$RELEASE_VERSION" --draft=false --prerelease=false
else
gh release create "$RELEASE_VERSION" release-assets/* \
--verify-tag \
--title "$RELEASE_VERSION" \
--generate-notes
fi