v1.10.3 - disable 1-click buy because of bug #18
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: Package Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
build-and-package: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
container: | |
[ | |
'chrome', | |
'firefox', | |
] | |
env: | |
BROWSER: ${{ matrix.container }} | |
VERSION: ${{ github.event.release.tag_name }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- run: npm install | |
- name: set version number in manifest | |
run: | | |
VERSION_NUMBER=$(echo ${VERSION} | sed 's/^v//') | |
sed -i 's/"version": *"[0-9.]*"/"version": "'$VERSION_NUMBER'"/' manifest.json | |
- name: build Chrome | |
if: ${{ matrix.container == 'chrome' }} | |
run: npm run build | |
- name: build Firefox | |
if: ${{ matrix.container == 'firefox' }} | |
run: | | |
sed -i 's,"service_worker": "dist/background.js","scripts": ["dist/background.js"],g' ./manifest.json | |
npm run build | |
- name: package | |
run: | | |
PACKAGE_NAME="BandcampEnhancementSuite_${BROWSER}-$VERSION.zip" | |
zip $PACKAGE_NAME LICENSE _locales/**/* icons/* css/* dist/* svg/* manifest.json html/browser_action.html | |
- name: attach packages to GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
GH_RELEASE_ID=${{ github.event.release.id }} | |
GH_REPO="https://uploads.github.com/repos/${{ github.repository }}/releases/$GH_RELEASE_ID/assets" | |
PACKAGE_NAME="BandcampEnhancementSuite_${BROWSER}-$VERSION.zip" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"$GH_REPO?name=$PACKAGE_NAME" \ | |
--data-binary "@$PACKAGE_NAME" |