Skip to content

Release

Release #12

Workflow file for this run

name: Release
on:
push:
tags:
- v*
jobs:
release:
permissions:
contents: write
name: Release ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@master
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
target: x86_64-apple-darwin
toolchain: stable
- if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get install libgtk-3-dev libsoup-2.4
- name: Compile
id: compile
run: |
set -x
WORKDIR="src-tauri"
OUTPUT_DIR="$WORKDIR/built/output"
mkdir -p "$OUTPUT_DIR"
echo "BUILT_ARCHIVES=$OUTPUT_DIR" >> $GITHUB_OUTPUT
set -xe;
pnpm tauri build --verbose
cargo build --manifest-path=$WORKDIR/Cargo.toml --release -p todo;
BINARIES=(mynd todo)
for BIN in $BINARIES; do
ARCHIVE=$BIN\_${TARGET}.tar.gz
BIN_PATH=$WORKDIR/target/release/$BIN
strip $BIN_PATH;
ARTIFACTS_FOLDER="${GITHUB_REPOSITORY#*/}_${GITHUB_REF_NAME}"
mkdir $ARTIFACTS_FOLDER
cp -r $BIN_PATH README.md LICENSE $ARTIFACTS_FOLDER
tar -caf $ARCHIVE $ARTIFACTS_FOLDER/*
mv $ARCHIVE $OUTPUT_DIR
done
env:
TARGET: ${{ matrix.target }}
- name: Name Release
run: echo "RELEASE_NAME=${GITHUB_REPOSITORY#*/} ${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
name: ${{ env.RELEASE_NAME }}
files: |
${{ steps.compile.outputs.BUILT_ARCHIVES }}/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}