Skip to content

deps(pip): bump the pip group in /docs with 1 update #405

deps(pip): bump the pip group in /docs with 1 update

deps(pip): bump the pip group in /docs with 1 update #405

Workflow file for this run

name: Build
on:
push:
branches: [master]
tags: ['*']
pull_request:
branches: [master]
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@v3
# ╭─────────────────────────────╮
# │ Build extension and overlay │
# ╰─────────────────────────────╯
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
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@v3
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: actions-rs/toolchain@v1
id: rust_chain
with:
profile: minimal
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ steps.rust_chain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-build
- name: Build
run: cargo build --release --locked
# ╭───────────────────╮
# │ Upload articfacts │
# ╰───────────────────╯
- uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
name: current-song2.exe
path: target/release/current-song2.exe
- uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
name: extension.${{ env.ext_type }}
path: js/extension/artifacts/*.${{ env.ext_type }}
- uses: actions/upload-artifact@v3
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'))
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: artifacts
- 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
- uses: ncipollo/release-action@v1
with:
artifacts: 'artifacts/**/*'
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: false
allowUpdates: true
bodyFile: body.txt
prerelease: ${{ env.ext_release == '0' }}