deps(pip): bump mkdocs-material from 9.5.40 to 9.5.42 in /docs in the pip group #679
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: Build | |
on: | |
push: | |
branches: [master, main] | |
tags: ['v*'] | |
pull_request: | |
branches: [master, main] | |
env: | |
CARGO_TERM_COLOR: always | |
ext_release: ${{ (github.event_name == 'push' && contains(github.ref, 'refs/tags/v') && !(contains(github.ref, 'beta') || contains(github.ref, 'alpha'))) && '1' || '0' }} | |
ext_type: ${{ (github.event_name == 'push' && contains(github.ref, 'refs/tags/v') && !(contains(github.ref, 'beta') || contains(github.ref, 'alpha'))) && 'xpi' || 'zip' }} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
name: 'Build on ${{matrix.os}}' | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
# ╭─────────────────────────────╮ | |
# │ Build extension and overlay │ | |
# ╰─────────────────────────────╯ | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
# https://github.com/parcel-bundler/parcel/issues/9926 | |
# node-version: latest | |
node-version: 22.6 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: latest | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: JS Build (no release) | |
run: pnpm run --if-present -r build | |
if: ${{ env.ext_release == '0' }} | |
- name: JS Build (release) | |
run: pnpm run --if-present -r release | |
if: ${{ env.ext_release == '1' }} | |
env: | |
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} | |
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} | |
- run: 7z a artifacts\client.zip .\js\client\dist\* | |
# ╭──────────────────╮ | |
# │ Build executable │ | |
# ╰──────────────────╯ | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --release --locked | |
# ╭───────────────────╮ | |
# │ Upload articfacts │ | |
# ╰───────────────────╯ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
name: current-song2.exe | |
path: target/release/current-song2.exe | |
- uses: actions/upload-artifact@v4 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
name: extension.${{ env.ext_type }} | |
path: js/extension/artifacts/*.${{ env.ext_type }} | |
- uses: actions/upload-artifact@v4 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
name: client.zip | |
path: artifacts/client.zip | |
create-release: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'push' && (contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')) | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- run: ls -la artifacts | |
- name: Get changelog (release) | |
if: contains(github.ref, 'refs/tags/v') | |
run: | | |
cat CHANGELOG.md | perl -0777nle 'print for /\n## \[v[^\n]++\s+((?:\s+|(?:[^#]|#{3,})[^\n]*\s+)*)/' > body.txt | |
- name: Get changelog (nightly) | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
run: | | |
cat CHANGELOG.md | perl -0777nle 'print for /\n## \[Unreleased\]\s+((?:\s+|(?:[^#]|#{3,})[^\n]*\s+)*)/g' > body.txt | |
- name: Hash Files | |
run: | | |
echo "### Hashes" >> body.txt | |
echo "| File | Hash |" >> body.txt | |
echo "|---|---|" >> body.txt | |
for file in $(find artifacts); | |
do | |
if [ ! -d "$file" ]; then | |
echo "| $(basename -- "$file") | $(sha256sum "$file" | cut -d " " -f 1) |" >> body.txt; | |
fi; | |
done | |
shell: bash | |
- name: Regular release | |
uses: ncipollo/release-action@v1 | |
if: contains(github.ref, 'refs/tags/v') | |
with: | |
artifacts: 'artifacts/**/*' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: false | |
allowUpdates: true | |
draft: true | |
bodyFile: body.txt | |
prerelease: ${{ env.ext_release == '0' }} | |
- name: Nightly release | |
uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
with: | |
artifacts: 'artifacts/**/*' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: false | |
replacesArtifacts: true | |
allowUpdates: true | |
bodyFile: body.txt | |
prerelease: true | |
name: Nightly Release | |
tag: nightly-build | |
- name: Update nightly-build tag | |
run: | | |
git tag -f nightly-build | |
git push -f origin nightly-build |