musescore-downloader/.github/workflows/release.yml

78 lines
2.2 KiB
YAML
Raw Normal View History

2020-10-29 20:58:26 +00:00
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version number. default: the version number in package.json'
required: false
npm_tag:
description: 'The tag to register the published NPM package with'
required: false
default: 'latest'
ref:
description: 'The branch, tag or SHA to release from'
required: false
env:
VERSION: ${{ github.event.inputs.version }}
NPM_TAG: ${{ github.event.inputs.npm_tag }}
2020-10-29 21:00:37 +00:00
REF: ${{ github.event.inputs.ref || github.sha }}
2020-10-29 20:58:26 +00:00
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: ${{ env.REF }}
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Set Env
run: |
VER=$(node -p "require('./package.json').version")
echo "VERSION=$VER" >> $GITHUB_ENV
if: ${{ !env.VERSION }}
- run: npm install
- name: Bump Version
run: npm version --allow-same-version --no-git-tag $VERSION
- run: npm run build
- run: npm run pack:ext
- name: NPM Publish
run: npm publish --tag $NPM_TAG
2020-10-29 21:06:49 +00:00
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 0301...
2020-10-29 20:58:26 +00:00
2020-10-30 01:27:50 +00:00
- run: mkdir -p web-ext-artifacts
- name: Sign Firefox Extension
id: web_ext_sign
uses: kewisch/action-web-ext@v1
2020-10-30 01:27:50 +00:00
continue-on-error: true
with:
cmd: sign
source: dist/ext.zip
2020-10-30 19:00:58 +00:00
channel: listed
apiKey: ${{ secrets.AMO_SIGN_KEY }}
apiSecret: ${{ secrets.AMO_SIGN_SECRET }}
2020-10-30 01:20:48 +00:00
- run: |
cp dist/main.js musescore-downloader.user.js && \
cp dist/ext.zip musescore-downloader.webextension.zip
2020-10-29 20:58:26 +00:00
- name: Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGNED_WEB_EXT: ${{ steps.web-ext-build.outputs.target }}
2020-10-29 20:58:26 +00:00
run: |
hub release create \
2020-10-30 01:20:48 +00:00
-a "musescore-downloader.user.js" \
-a "musescore-downloader.webextension.zip" \
-a "$SIGNED_WEB_EXT" \
2020-10-29 20:58:26 +00:00
-m v$VERSION \
-t $REF \
v$VERSION