Skip to content

Bump checkout action version #21

Bump checkout action version

Bump checkout action version #21

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: [self-hosted, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Get Firefox extension version
uses: sergeysova/jq-action@v2
id: firefox_version
with:
cmd: 'jq -r .version firefox_manifest.json'
- name: Get Chrome extension version
uses: sergeysova/jq-action@v2
id: chrome_version
with:
cmd: 'jq -r .version chrome_manifest.json'
- name: Check extension versions
run: |
if [ "${{ steps.firefox_version.outputs.value }}" != "${{ steps.chrome_version.outputs.value }}" ]; then
echo "Extension versions do not match (${{ steps.firefox_version.outputs.value }} != ${{ steps.chrome_version.outputs.value }})"
exit 1
fi
if [ "refs/tags/v${{ steps.firefox_version.outputs.value }}" != "${{ github.ref }}" ]; then
echo "Tag (${{ github.ref }}) does not match extension version (${{ steps.firefox_version.outputs.value }})"
exit 1
fi
- name: Prepare for Firefox build
run: |
bash bin/prepare_build.sh firefox
mkdir -p dist
- name: Add Firefox extension id to manifest
uses: sergeysova/jq-action@v2
with:
cmd: 'echo $(jq ". += {\"browser_specific_settings\": {\"gecko\": {\"id\": \"${{ vars.FIREFOX_EXTENSION_ID }}\"}}}" build/manifest.json) > build/manifest.json'
- name: Firefox build
uses: kewisch/action-web-ext@v1
id: firefox_build
with:
cmd: build
source: build
artifactsDir: dist
- name: Sign Firefox extension
uses: kewisch/action-web-ext@v1
id: firefox_sign
with:
cmd: sign
source: ${{ steps.firefox_build.outputs.target }}
apiKey: ${{ secrets.FIREFOX_JWT_ISSUER }}
apiSecret: ${{ secrets.FIREFOX_JWT_SECRET }}
- name: Rename Firefox extension
run: mv ${{ steps.firefox_sign.outputs.target }} dist/OF-DL_Auth_Helper-firefox-${{ steps.firefox_version.outputs.value }}.xpi
- name: Prepare for Chrome build
run: |
bash bin/prepare_build.sh chrome
- name: Chrome pack extension
uses: cardinalby/webext-buildtools-pack-extension-dir-action@v1
with:
extensionDir: build
zipFilePath: dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.zip
- name: Upload artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
fail_on_unmatched_files: true
files: |
dist/OF-DL_Auth_Helper-firefox-${{ steps.firefox_version.outputs.value }}.xpi
dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.zip