Skip to content

0.33.0

0.33.0 #90

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
build:
name: Create Release
environment: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: actions/setup-node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install build environment
run: npm ci
# Run lint, type-checking and tests before release
- name: Running lint and type check
run: npm run lint && npm run check-types
- name: Create build of test content script
run: npm run build
# FIXME: Tests too flaky, disabled for release
# - name: Run the tests
# run: npm run test
- name: Set tag name in env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build project and create dist files
run: "./dist.sh"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
body: ""
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dist/bibbot.zip
asset_name: bibbot-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
- name: "web-ext build"
id: web-ext-build
uses: kewisch/action-web-ext@d5376aebf5a5f167924728cf9b43d6e9e8ee10e0
with:
cmd: build
source: ./dist/bibbot
- name: "web-ext sign"
id: web-ext-sign
uses: kewisch/action-web-ext@d5376aebf5a5f167924728cf9b43d6e9e8ee10e0
with:
cmd: sign
source: ${{ steps.web-ext-build.outputs.target }}
channel: listed
apiKey: ${{ secrets.FIREFOX_API_KEY }}
apiSecret: ${{ secrets.FIREFOX_API_SECRET }}
timeout: 900000
# # Because it's listed, we are not getting a signed asset anymore
# - name: Upload Release XPI Asset
# id: upload-release-xpi-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ${{ steps.web-ext-sign.outputs.target }}
# asset_name: bibbot-${{ env.RELEASE_VERSION }}.xpi
# asset_content_type: application/x-xpinstall
- name: Trigger GitHub pages rebuild
run: |
curl --fail --request POST \
--url https://api.github.com/repos/${{ github.repository }}/pages/builds \
--header "Authorization: Bearer $USER_TOKEN"
env:
# You must create a personal token with repo access as GitHub does
# not yet support server-to-server page builds.
USER_TOKEN: ${{ secrets.USER_TOKEN }}
- name: "Publish to Chrome Web Store"
uses: trmcnvn/chrome-addon@7fc5a5ad3ff597dc64d6a13de7dcaa8515328be7
with:
extension: edafomjglmkfbiieocpflnhfdmikkhbo
zip: ./dist/bibbot.zip
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}