Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci test2 Andere Variante #28

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5abe1cd
Version number
denismaier May 30, 2024
0bba4da
Release 0.2.99
denismaier May 31, 2024
2a3cc73
0.2.99
denismaier May 31, 2024
07047b6
0.2.100
denismaier May 31, 2024
d6be097
v0.2.100
denismaier May 31, 2024
d1e3c84
v0.2.100
denismaier May 31, 2024
4f26d95
v1.2.3
denismaier May 31, 2024
a037598
v1.2.4
denismaier May 31, 2024
91ba3b3
Version 1.2.5
denismaier May 31, 2024
028ff12
Version 1.2.6
denismaier May 31, 2024
7355293
Version 1.2.7
denismaier May 31, 2024
4ab4015
Version 1.28
denismaier May 31, 2024
0ce9874
Version 1.29
denismaier May 31, 2024
29004a5
add workflow
denismaier May 31, 2024
9ea740d
Version 1.789
denismaier May 31, 2024
cfccd8f
Version 2
denismaier May 31, 2024
39bd347
Version 3
denismaier May 31, 2024
5b2c62e
Version 4
denismaier May 31, 2024
4d44231
Version 5
denismaier May 31, 2024
1fe8791
Version 5.1
denismaier May 31, 2024
82d3ddc
Version 5.2
denismaier May 31, 2024
cf7851e
Version 5.3
denismaier May 31, 2024
696459e
Version 5.4
denismaier May 31, 2024
6df214f
adds a lot of stuff
denismaier May 31, 2024
c36a36d
Version 5.5
denismaier May 31, 2024
2975733
Version 5.6
denismaier May 31, 2024
aef8437
workflow
denismaier May 31, 2024
941af26
Version 5.7
denismaier May 31, 2024
ffbd85a
workflow
denismaier May 31, 2024
6b32d71
Version 5.7.2
denismaier May 31, 2024
e08e8f7
test
denismaier May 31, 2024
dda10e3
Version 10
denismaier May 31, 2024
a97b459
Version 11
denismaier May 31, 2024
8930717
Version 12
denismaier May 31, 2024
b025643
change workflow
denismaier May 31, 2024
b88efc8
Version 13
denismaier May 31, 2024
9c693bd
Version 14
denismaier May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 50
fetch-tags: true

- name: Setup git
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub CI"

- name: Test
run: echo "Are we here?"

- name: Show Tag
run: echo $(git describe --tags || echo ci-test)

# - name: Install dependencies
# run: sudo apt update && sudo apt install jq

# - name: Echo tag version
# run: echo $(git describe --tags || echo ci-test)

# - name: Run build
# run: ./build.sh $(git describe --tags || echo ci-test)

# - name: Prepare Update Manifests
# run: ./publish.sh $(git describe --tags || echo ci-test )

# - uses: actions/upload-artifact@v4
# with:
# name: Zotero Swisscovery UB Bern plugin (zipped)
# path: "build/*.xpi"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
.project
*.xpi
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

version="$1"
if [ -z "$version" ]; then
read -p "Enter new version number: " version
fi

echo "Building version ${version}"

assetname=zotero-swisscovery-ubbern-locations

## Update install.rdf and manifest.json

perl -pi -e "s/em:version=\"[^\"]*/em:version=\"$version/;" src/install.rdf
# perl -pi -e "s/\"version\": \"[^\"]*\"/\"version\": \"$version\"/" src/manifest.json

# Create build folder
rm -rf build
mkdir build

# Create build zip
zip -r build/${assetname}-${version}.xpi src/*
6 changes: 0 additions & 6 deletions makefile

This file was deleted.

21 changes: 21 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

version="$1"
if [ -z "$version" ]; then
read -p "Enter new version number: " version
fi

assetname=zotero-swisscovery-ubbern-locations
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


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"

21 changes: 21 additions & 0 deletions release copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

version="$1"
if [ -z "$version" ]; then
read -p "Enter new version number: " version
fi

assetname=zotero-swisscovery-ubbern-locations
updatelink=https://github.com/ub-unibe-ch/zotero-swissbib-bb-locations/releases/download/${version}/${assetname}-${version}.xpi

# Update updates.json
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






27 changes: 27 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

################################################
# Get next version number
################################################

current=$(git describe --tags)
echo "Current version: $current"
read -r -p "Enter new version number: " version
echo "Next version set to: $version"

################################################
## Update install.rdf and manifest.json
################################################

perl -pi -e "s/em:version=\"[^\"]*/em:version=\"$version/;" src/install.rdf
# perl -pi -e "s/\"version\": \"[^\"]*\"/\"version\": \"$version\"/" src/manifest.json

################################################
# Commit and push
################################################

git add src/install.rdf #src/manifest.json
git commit -m "Version ${version}" 1>&2
git push
git tag -a -m "Version ${version}" "${version}"
git push origin "${version}"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion install.rdf → src/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RDF:about="urn:mozilla:install-manifest"
em:id="[email protected]"
em:name="Zotero Swisscovery UB Bern Locations"
em:version="0.2.9"
em:version="14"
em:type="2"
em:creator="Denis Maier"
em:description="Zotero/Jurism-Plugin zur Bestandsabfrage im Swisscovery UB Bern"
Expand Down
30 changes: 0 additions & 30 deletions update.rdf

This file was deleted.

22 changes: 22 additions & 0 deletions updates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"addons": {
"[email protected]": {
"updates": [
{
"version": "1.2.3",
"update_link": "",
"update_hash": "sha256:shasum:",
"applications": {
"gecko": {
"strict_min_version": "60.0"
},
"zotero": {
"strict_min_version": "6.999",
"strict_max_version": "7.0.*"
}
}
}
]
}
}
}
22 changes: 22 additions & 0 deletions updates.json.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"addons": {
"[email protected]": {
"updates": [
{
"version": "",
"update_link": "",
"update_hash": "",
"applications": {
"gecko": {
"strict_min_version": "60.0"
},
"zotero": {
"strict_min_version": "6.999",
"strict_max_version": "7.0.*"
}
}
}
]
}
}
}