Update extension version to 0.3.4 and streamline Git config #6
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
name: Build, Sign, and Release Firefox Extension | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install web-ext | |
run: npm install --global web-ext | |
- name: Build and sign the extension | |
run: web-ext sign --artifacts-dir ./artifacts --api-key ${{ secrets.AMO_JWT_ISSUER }} --api-secret ${{ secrets.AMO_JWT_SECRET }} | |
env: | |
WEB_EXT_API_KEY: ${{ secrets.JWT_ISSUER }} | |
WEB_EXT_API_SECRET: ${{ secrets.JWT_SECRET }} | |
- name: Find signed XPI file name | |
id: find-xpi | |
run: echo "::set-output name=xpi_name::$(ls ./artifacts/*.xpi)" | |
- name: Extract version for tag and release name | |
id: extract-version | |
run: | | |
XPI_NAME="${{ steps.find-xpi.outputs.xpi_name }}" | |
VERSION_PART=$(echo "$XPI_NAME" | cut -d '-' -f 2) | |
echo "::set-output name=version::$VERSION_PART" | |
- name: Configure Git | |
run: | |
git config --global user.email "imigueldiaz@gmail.com" | |
git config --global user.name "Ignacio de Miguel Díaz" | |
- name: Create Tag | |
run: | | |
VERSION="${{ steps.extract-version.outputs.version }}" | |
TAG_NAME="v$VERSION" | |
echo "Creating tag $TAG_NAME" | |
git config --global user.email "imigueldiaz@gmail.com" | |
git config --global user.name "Ignacio de Miguel Díaz" | |
git tag -a $TAG_NAME -m "Release version $TAG_NAME" | |
git push origin $TAG_NAME | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload signed XPI as a release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.find-xpi.outputs.xpi_name }} | |
tag_name: ${{ steps.extract-version.outputs.version }} | |
name: Release ${{ steps.extract-version.outputs.version }} | |
draft: false | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |