Skip to content

release: v0.6.1

release: v0.6.1 #19

Workflow file for this run

name: release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v0.1.0)'
required: true
default: v0.1.0
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build workspace packages
run: pnpm run build:packages
- name: Build installer (macOS)
if: matrix.os == 'macos-latest'
run: pnpm --filter=@scrapeman/desktop dist:mac
env:
# Don't try to discover a real Developer ID cert in the runner's
# keychain — there isn't one. electron-builder.yml pins
# `mac.identity: '-'` so it falls back to ad-hoc signing
# (mandatory on Apple Silicon Big Sur+ to avoid the misleading
# "App is damaged" error on download).
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Build installer (Windows)
if: matrix.os == 'windows-latest'
run: pnpm --filter=@scrapeman/desktop dist:win
- name: Build installer (Linux)
if: matrix.os == 'ubuntu-latest'
run: pnpm --filter=@scrapeman/desktop dist:linux
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: scrapeman-${{ matrix.os }}
path: |
apps/desktop/release/*.dmg
apps/desktop/release/*.exe
apps/desktop/release/*.AppImage
apps/desktop/release/*.deb
apps/desktop/release/*.zip
apps/desktop/release/*.blockmap
if-no-files-found: error
retention-days: 14
release:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Flatten artifact tree
run: |
mkdir -p release
find artifacts -type f \( -name '*.dmg' -o -name '*.exe' -o -name '*.AppImage' -o -name '*.deb' -o -name '*.zip' -o -name '*.blockmap' \) -exec cp {} release/ \;
ls -la release/
- name: Create / update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag || github.ref_name }}
name: ${{ inputs.tag || github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
files: release/*
body: |
## Install / Upgrade
**Homebrew (macOS)** — refresh the tap cache first, otherwise `brew` keeps serving the old cask:
```sh
brew update && brew upgrade scrapeman
```
First time installing:
```sh
brew install --cask scrape-do/scrapeman/scrapeman
```
**Other platforms** — grab the installer from the Assets below.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
bump-cask:
name: Bump Homebrew cask
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout tap repo
uses: actions/checkout@v4
with:
repository: scrape-do/homebrew-scrapeman
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: tap
- name: Compute version + SHA256s
id: hashes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ inputs.tag || github.ref_name }}
run: |
set -euo pipefail
VERSION="${TAG#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
mkdir -p dmgs
gh release download "$TAG" \
--repo "${{ github.repository }}" \
--pattern "Scrapeman-${VERSION}-arm64.dmg" \
--pattern "Scrapeman-${VERSION}-x64.dmg" \
--dir dmgs
ARM_SHA=$(shasum -a 256 "dmgs/Scrapeman-${VERSION}-arm64.dmg" | awk '{print $1}')
INTEL_SHA=$(shasum -a 256 "dmgs/Scrapeman-${VERSION}-x64.dmg" | awk '{print $1}')
echo "arm=$ARM_SHA" >> "$GITHUB_OUTPUT"
echo "intel=$INTEL_SHA" >> "$GITHUB_OUTPUT"
echo "version=$VERSION arm=$ARM_SHA intel=$INTEL_SHA"
- name: Patch cask
working-directory: tap
env:
VERSION: ${{ steps.hashes.outputs.version }}
ARM_SHA: ${{ steps.hashes.outputs.arm }}
INTEL_SHA: ${{ steps.hashes.outputs.intel }}
run: |
set -euo pipefail
# Update the version line, then the on_arm sha256 (between
# `on_arm do` and `on_intel do`), then the on_intel sha256
# (between `on_intel do` and the next bare `end`).
sed -i \
-e "s/^ version \".*\"/ version \"$VERSION\"/" \
-e "/on_arm do/,/on_intel do/ s/^ sha256 \".*\"/ sha256 \"$ARM_SHA\"/" \
-e "/on_intel do/,/^ end\$/ s/^ sha256 \".*\"/ sha256 \"$INTEL_SHA\"/" \
Casks/scrapeman.rb
echo '--- patched cask ---'
cat Casks/scrapeman.rb
- name: Commit and push
working-directory: tap
env:
VERSION: ${{ steps.hashes.outputs.version }}
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if git diff --quiet; then
echo "Cask already at v$VERSION, nothing to push."
exit 0
fi
git add Casks/scrapeman.rb
git commit -m "chore(cask): bump scrapeman to v$VERSION"
git push