Merge pull request #344 from JonasKruckenberg/renovate/pnpm-8.x #282
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: covector version or publish | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
version-or-release: | |
runs-on: ubuntu-latest | |
outputs: | |
willPublish: ${{ steps.covector-status.outputs.willPublish-pisano }} | |
version: ${{ steps.covector-status.outputs.version-pisano }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: covector status | |
uses: jbolda/covector/packages/action@covector-v0 | |
id: covector-status | |
with: | |
command: 'status' | |
- name: git config | |
if: ${{ steps.covector-status.outputs.status != 'No changes.' }} | |
run: | | |
git config --global user.name "${{ github.event.pusher.name }}" | |
git config --global user.email "${{ github.event.pusher.email }}" | |
- name: covector version | |
uses: jbolda/covector/packages/action@covector-v0 | |
id: covector-version | |
if: ${{ steps.covector-status.outputs.status != 'No changes.' }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
command: 'version' | |
- name: Create Pull Request With Versions Bumped | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
if: ${{ steps.covector-status.outputs.status != 'No changes.' }} | |
with: | |
title: 'Publish New Versions' | |
commit-message: 'publish new versions' | |
labels: 'version updates' | |
branch: 'release' | |
body: ${{ steps.covector-version.outputs.change }} | |
build-binaries: | |
runs-on: ${{ matrix.config.os }} | |
needs: [version-or-release] | |
if: needs.version-or-release.outputs.willPublish | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- os: ubuntu-latest | |
arch: x86_64 | |
rust_target: x86_64-unknown-linux-gnu | |
- os: macos-latest | |
arch: x86_64 | |
rust_target: x86_64-apple-darwin | |
- os: macos-latest | |
arch: aarch64 | |
rust_target: aarch64-apple-darwin | |
- os: windows-latest | |
arch: x86_64 | |
rust_target: x86_64-pc-windows-msvc | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Setup Rust' | |
uses: actions-rs/toolchain@v1 | |
with: | |
default: true | |
override: true | |
profile: minimal | |
toolchain: stable | |
target: ${{ matrix.config.rust_target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.config.rust_target }} | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: pnpm/[email protected] | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
key: ${{ runner.os }}-${{ matrix.config.arch }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.config.arch }}-pnpm-store- | |
- uses: pnpm/[email protected] | |
with: | |
run_install: true | |
- name: install webkit2gtk (ubuntu only) | |
if: matrix.config.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y webkit2gtk-4.0 libgtk-3-dev | |
# - name: create apple private key file | |
# if: "matrix.config.os == 'macos-latest'" | |
# run: | | |
# mkdir ./desktop/app/private_keys | |
# echo "$APPLE_API_PRIVKEY" > ./desktop/app/private_keys/AuthKey_$APPLE_API_KEY.p8 | |
# env: | |
# APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' | |
# APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' | |
- uses: JonasKruckenberg/[email protected] | |
id: tauri_build | |
env: | |
VERSION: ${{ needs.get-version.outputs.version }} | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
# ENABLE_CODE_SIGNING: '${{ secrets.APPLE_CERTIFICATE }}' | |
# APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' | |
# APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' | |
# APPLE_CERTIFICATE: '${{ secrets.APPLE_CERTIFICATE }}' | |
# APPLE_CERTIFICATE_PASSWORD: | |
# '${{ secrets.APPLE_CERTIFICATE_PASSWORD }}' | |
# APPLE_SIGNING_IDENTITY: '${{ secrets.APPLE_SIGNING_IDENTITY }}' | |
# TAURI_KEY_PASSWORD: '${{ secrets.TAURI_KEY_PASSWORD }}' | |
# TAURI_PRIVATE_KEY: '${{ secrets.TAURI_PRIVATE_KEY }}' | |
with: | |
target: ${{ matrix.config.rust_target }} | |
args: --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts-${{ matrix.config.arch }} | |
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" | |
publish-to-github: | |
needs: [version-or-release, build-binaries] | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download x86_64 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifacts-x86_64 | |
path: artifacts/x86_64 | |
- name: Download aarch64 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifacts-aarch64 | |
path: artifacts/aarch64 | |
- name: Rename .app artifacts | |
run: | | |
mv "./artifacts/x86_64/macos/Pisano.app.tar.gz" "./artifacts/x86_64/macos/Pisano_${{ needs.version-or-release.outputs.version }}_x86.app.tar.gz" | |
mv "./artifacts/aarch64/macos/Pisano.app.tar.gz" "./artifacts/aarch64/macos/Pisano_${{ needs.version-or-release.outputs.version }}_aarch64.app.tar.gz" | |
- name: 'create release' | |
uses: softprops/action-gh-release@master | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
with: | |
tag_name: v${{ needs.version-or-release.outputs.version }} | |
generate_release_notes: true | |
files: ./artifacts/**/* |