Release #16
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: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag name (e.g. v1.0.0)' | |
required: true | |
type: string | |
# Add permissions block | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
target: | |
# - target: macos | |
# os: macos-latest | |
# make: bash scripts/build-macos.sh | |
# package: bash scripts/package-macos.sh | |
- target: linux | |
os: ubuntu-latest | |
make: bash scripts/package-linux.sh package | |
artifact_path: | | |
echo "ARTIFACT_PATH=$(bash scripts/package-linux.sh archive_path)" >> "$GITHUB_ENV" | |
runs-on: ${{ matrix.target.os }} | |
environment: signing | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- uses: DeterminateSystems/flake-checker-action@main | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
env-vars: CARGO USE_VENDOR_FEATURE | |
- name: Build | |
run: nix develop --command bash -c "${{ matrix.target.make }}" | |
- name: Sign macOS | |
if: matrix.target.target == 'macos' | |
env: | |
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | |
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }} | |
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }} | |
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }} | |
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} | |
MACOS_NOTARIZATION_PWD: ${{ secrets.MACOS_NOTARIZATION_PWD }} | |
run: nix develop --command bash -c "scripts/sign-macos.sh" | |
- name: Package DMG | |
run: nix develop --command bash -c "${{ matrix.target.package }}" | |
- name: Set artifact path | |
if: matrix.target.target == 'linux' | |
run: ${{ matrix.target.artifact_path }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target.target }} | |
path: ${{ env.ARTIFACT_PATH }} | |
- name: Create Release and Upload Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Release ${{ github.event.inputs.tag || github.ref_name }} | |
tag_name: ${{ github.event.inputs.tag || github.ref_name }} | |
draft: true | |
prerelease: false | |
generate_release_notes: true | |
files: | | |
target/release/macos/harbor.dmg | |
${{ env.ARTIFACT_PATH }} |