-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0496bd
commit f1b2113
Showing
1 changed file
with
56 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
name: Firefox Extension Release | ||
#name: Firefox Extension Release | ||
|
||
on: | ||
create: | ||
tags: # Only trigger when a tag is created | ||
- '*' | ||
#on: | ||
# create: | ||
# tags: # Only trigger when a tag is created | ||
# - '*' | ||
|
||
permissions: | ||
contents: read | ||
#permissions: | ||
# contents: read | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: write # Required for creating a release | ||
name: Build and Upload Firefox Extension | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
#jobs: | ||
# build: | ||
# permissions: | ||
# contents: write # Required for creating a release | ||
# name: Build and Upload Firefox Extension | ||
# runs-on: ubuntu-latest | ||
# if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v2 | ||
# with: | ||
# persist-credentials: false | ||
|
||
- name: Get release information | ||
id: release_info | ||
run: | | ||
echo "::set-output name=VERSION::${GITHUB_REF/refs/tags/}" | ||
# - name: Get release information | ||
# id: release_info | ||
# run: | | ||
# echo "::set-output name=VERSION::${GITHUB_REF/refs/tags/}" | ||
|
||
- name: Install web-ext | ||
run: npm install --global web-ext | ||
# - name: Install web-ext | ||
# run: npm install --global web-ext | ||
|
||
- name: Build and Sign Firefox Extension | ||
run: | | ||
web-ext sign --source-dir . \ | ||
--artifacts-dir web-ext-artifacts \ | ||
--api-key ${{ secrets.AMO_API_KEY }} \ | ||
--api-secret ${{ secrets.AMO_API_SECRET }} \ | ||
--channel unlisted \ | ||
--no-input | ||
env: | ||
AMO_API_KEY: ${{ secrets.AMO_API_KEY }} | ||
AMO_API_SECRET: ${{ secrets.AMO_API_SECRET }} | ||
# - name: Build and Sign Firefox Extension | ||
# run: | | ||
# web-ext sign --source-dir . \ | ||
# --artifacts-dir web-ext-artifacts \ | ||
# --api-key ${{ secrets.AMO_API_KEY }} \ | ||
# --api-secret ${{ secrets.AMO_API_SECRET }} \ | ||
# --channel unlisted \ | ||
# --no-input | ||
# env: | ||
# AMO_API_KEY: ${{ secrets.AMO_API_KEY }} | ||
# AMO_API_SECRET: ${{ secrets.AMO_API_SECRET }} | ||
|
||
- name: Create GitHub release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.release_info.outputs.VERSION }} | ||
release_name: "Firefox Extension v${{ steps.release_info.outputs.VERSION }}" | ||
draft: false | ||
prerelease: false | ||
body: "Release version ${{ steps.release_info.outputs.VERSION }} of the Firefox extension." | ||
# - name: Create GitHub release | ||
# id: create_release | ||
# uses: actions/create-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# tag_name: ${{ steps.release_info.outputs.VERSION }} | ||
# release_name: "Firefox Extension v${{ steps.release_info.outputs.VERSION }}" | ||
# draft: false | ||
# prerelease: false | ||
# body: "Release version ${{ steps.release_info.outputs.VERSION }} of the Firefox extension." | ||
|
||
- name: Upload Firefox package to GitHub Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: web-ext-artifacts/*.xpi # Use the signed extension from the artifacts | ||
asset_name: your-extension-${{ steps.release_info.outputs.VERSION }}.xpi | ||
asset_content_type: application/x-xpinstall | ||
# - name: Upload Firefox package to GitHub Release | ||
# uses: actions/upload-release-asset@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
# asset_path: web-ext-artifacts/*.xpi # Use the signed extension from the artifacts | ||
# asset_name: your-extension-${{ steps.release_info.outputs.VERSION }}.xpi | ||
# asset_content_type: application/x-xpinstall |