Skip to content

Workflow file for this run

# Build Zotero plugin.
name: Build Zotero Swisscovery UB Bern plugin
on:
pull_request:
branches: [ "master" ]
jobs:
build-plugin:
name: Build and release plugin
runs-on: ubuntu-latest
env:
assetname: zotero-swisscovery-ubbern-locations
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup git
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub CI"
- name: Install dependencies
run: sudo apt update && sudo apt install jq
- name: Run build
run: |
version=$(git describe --tags || echo ci-test)
mkdir build
zip -r build/${assetname}-${version}.xpi src/*
# zip -r build/test.xpi src/*
- name: Prepare Update M anifests
run: |
version=$(git describe --tags || echo ci-test)
updatelink=https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/${version}/${assetname}-${version}.xpi
jq ".addons[\"[email protected]\"].updates[0].update_hash = \"sha256:`shasum -a 256 build/${assetname}-${version}.xpi | cut -d' ' -f1`\"" updates.json.tmpl |
jq --arg version "$version" '.addons["[email protected]"].updates[0].version = $version' |
jq --arg updatelink "$updatelink" '.addons["[email protected]"].updates[0].update_link = $updatelink' > updates.json
cp updates.json update.rdf
- name: Publish release
run: |
version=$(git describe --tags || echo ci-test)
git add src/install.rdf update.rdf updates.json # src/manifest.json
git commit -m "Release $version" 1>&2
git tag -a -m "Release $version" "$version"
- uses: actions/upload-artifact@v4
with:
name: Zotero Swisscovery UB Bern plugin (zipped)
path: "build/*.xpi"