Skip to content

Publish

Publish #4

Workflow file for this run

###############################################################################
# PLBLISH CHROME EXTENSION AND FIREFOX EXTENSION
###############################################################################
name: Publish
###############################################################################
# ON
###############################################################################
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
version:
description: 'Set number for release version'
type: string
required: true
###############################################################################
# JOBS
###############################################################################
jobs:
build:
name: Publish web extensions (Chrome & firefox) and release in github
runs-on: macos-latest
permissions:
contents: write
###########################################################################
# STEPS
###########################################################################
steps:
#########################################################################
# INIT & BUILD PKG
#########################################################################
- name: checks-out repository
uses: actions/checkout@v3
#########################################################################
# IF IS IN MAIN BRANCH
#########################################################################
# - name: Exit if not on MAIN branch
# if: endsWith(github.ref, 'main') == false
# run: exit -1
#########################################################################
# BUILD PKG
#########################################################################
- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
- name: Install pkg dependencies
run: |
pnpm install
pnpm build
#########################################################################
# GET PKG INFO
#########################################################################
- name: Get package info
id: package
uses: codex-team/[email protected]
# #########################################################################
# # CHROME
# #########################################################################
# - name: Upload CHROME extension
# uses: Klemensas/[email protected]
# with:
# refresh-token: '${{ secrets.CHOME_EXTENSION_REFRESH_TOKEN }}'
# client-id: '${{ secrets.CHOME_EXTENSION_CLIENT_ID }}'
# client-secret: '${{ secrets.CHOME_EXTENSION_CLIENT_SECRET }}'
# file-name: '.dist/comp/chrome-${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.zip'
# app-id: 'nnkleafalbcmeamobndfmcjhphipnnaj'
# publish: true
# # uses: mnao305/[email protected]
# # with:
# # file-path: dist/comp/chrome-${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.zip
# # # id of the extension in chrome
# # extension-id: nnkleafalbcmeamobndfmcjhphipnnaj
# # # instructions to get secrets:
# # # https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md
# # client-id: ${{ secrets.CHOME_EXTENSION_CLIENT_ID }}
# # client-secret: ${{ secrets.CHOME_EXTENSION_CLIENT_SECRET }}
# # refresh-token: ${{ secrets.CHOME_EXTENSION_REFRESH_TOKEN }}
# #########################################################################
# # FIREFOX
# #########################################################################
- name: Upload FIREFOX extension
uses: trmcnvn/firefox-addon@v1
with:
# uuid is only necessary when updating an existing addon,
# omitting it will create a new addon
uuid: '{5620af48-521a-4fbd-a153-26f3a7dfb613}'
xpi: dist/comp/firefox-${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.zip
manifest: dist/firefox/manifest.json
# get keys in:
# https://addons.mozilla.org/en-US/developers/addon/api/key/
api-key: ${{ secrets.FIREFOX_API_KEY }}
api-secret: ${{ secrets.FIREFOX_API_SECRET }}
continue-on-error: true
#########################################################################
# GITHUB RELEASE
#########################################################################
- name: Create Github release
uses: ncipollo/release-action@v1
with:
tag: "${{ github.event.inputs.version }}"
name: 'Super8 v${{ github.event.inputs.version }}'
draft: false
prerelease: false
allowUpdates: true
artifacts: "build/extensions/*"
body: |
🧩 View changelog at: https://github.com/pigeonposse/shortskiller/blob/main/CHANGELOG.md
📜 View license: https://github.com/pigeonposse/shortskiller/blob/main/LICENSE
###############################################################################