This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
Update dependency eslint to v8.57.1 #333
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: 'CI' | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
create-release: | |
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'release')) }} | |
permissions: | |
contents: write | |
runs-on: ubuntu-22.04 | |
outputs: | |
release_id: ${{ steps.create-release.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
PACKAGE_JSON_PATH="./apps/desktop" | |
echo "PACKAGE_VERSION=$(cat ${PACKAGE_JSON_PATH}/package.json | jq ".version" | tr -d '""')" >> $GITHUB_ENV | |
shell: bash | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Create release | |
id: create-release | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { data } = await github.rest.repos.createRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag_name: `pathfinder-${process.env.PACKAGE_VERSION}`, | |
name: `Pathfinder ${process.env.PACKAGE_VERSION} Beta`, | |
body: '', | |
draft: true, | |
prerelease: false | |
}) | |
return data.id | |
build-tauri: | |
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'release')) }} | |
needs: create-release | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [macos-latest, ubuntu-20.04, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: | | |
PACKAGE_JSON_PATH="./apps/desktop" | |
echo "PACKAGE_VERSION=$(cat ${PACKAGE_JSON_PATH}/package.json | jq ".version" | tr -d '""')" >> $GITHUB_ENV | |
shell: bash | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install aarch64-apple-darwin toolchain (macos only) | |
if: matrix.platform == 'macos-latest' | |
run: 'rustup target add aarch64-apple-darwin' | |
- name: Install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-20.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: Install frontend dependencies | |
run: pnpm install | |
- run: | | |
pushd ./packages/react | |
pnpm run build | |
popd | |
- name: Build (ubuntu and windows) | |
uses: tauri-apps/tauri-action@v0 | |
if: matrix.platform != 'macos-latest' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
projectPath: 'apps/desktop' | |
releaseId: ${{ needs.create-release.outputs.release_id }} | |
- name: Build (macos) | |
uses: tauri-apps/tauri-action@v0 | |
if: matrix.platform == 'macos-latest' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }} | |
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
with: | |
projectPath: 'apps/desktop' | |
releaseId: ${{ needs.crate-release.outputs.release_id}} | |
args: --target universal-apple-darwin | |
- name: Upload universal .dmg (macos only) | |
if: matrix.platform == 'macos-latest' | |
uses: actions/github-script@v6 | |
env: | |
release_id: ${{ needs.create-release.outputs.release_id }} | |
with: | |
script: | | |
const { PACKAGE_VERSION } = process.env; | |
const fs = require('fs'); | |
const contentLength = (filePath) => fs.statSync(filePath).size; | |
const path = `./apps/desktop/src-tauri/target/universal-apple-darwin/release/bundle/dmg/Pathfinder_${PACKAGE_VERSION}_universal.dmg`; | |
const headers = { | |
'content-type': 'application/octet-stream', | |
'content-length': contentLength(path), | |
}; | |
await github.rest.repos.uploadReleaseAsset({ | |
headers, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: process.env.release_id, | |
name: `pathfinder-${PACKAGE_VERSION}-universal-apple-darwin.dmg`, | |
data: fs.readFileSync(path) | |
}); | |
- name: Upload LICENSE | |
continue-on-error: true | |
uses: actions/github-script@v6 | |
env: | |
release_id: ${{ needs.create-release.outputs.release_id }} | |
with: | |
script: | | |
const { PACKAGE_VERSION } = process.env; | |
const fs = require('fs'); | |
const contentLength = (filePath) => fs.statSync(filePath).size; | |
const path = `./LICENSE`; | |
const headers = { | |
'content-length': contentLength(path), | |
}; | |
await github.rest.repos.uploadReleaseAsset({ | |
headers, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: process.env.release_id, | |
name: `LICENSE`, | |
data: fs.readFileSync(path) | |
}); | |
publish-release: | |
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'release')) }} | |
permissions: | |
contents: write | |
runs-on: ubuntu-22.04 | |
needs: [create-release, build-tauri] | |
steps: | |
- name: Publish release | |
id: publish-release | |
uses: actions/github-script@v6 | |
env: | |
release_id: ${{ needs.create-release.outputs.release_id }} | |
with: | |
script: | | |
github.rest.repos.updateRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: process.env.release_id, | |
draft: false, | |
prerelease: false | |
}) |