Skip to content

moved prefix to its own step #13

moved prefix to its own step

moved prefix to its own step #13

Workflow file for this run

name: Build and Package
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-latest
outputs:
CHROME: ${{ steps.def_file_name.outputs.CHROME }}
FIREFOX: ${{ steps.def_file_name.outputs.FIREFOX }}
SAFARI: ${{ steps.def_file_name.outputs.SAFARI }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Define prefix
run: echo "AWSF=awsf" >> $GITHUB_ENV
- name: Define file name
id: def_file_name
run: |
echo "CHROME=${{ env.AWSF }}-chrome" >> $GITHUB_OUTPUT
echo "FIREFOX=${{ env.AWSF }}-firefox" >> $GITHUB_OUTPUT
echo "SAFARI=${{ env.AWSF }}-safari" >> $GITHUB_OUTPUT
- name: Setup repo
uses: actions/checkout@v4
- name: Extract current version
id: get_version
run: |
VERSION=$(grep -oP '"version":\s*"\K[0-9.]+' manifest/template-manifest.json)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create versioned directory
run: mkdir -p dist/v${{ env.VERSION }}
chrome:
runs-on: ubuntu-latest
needs: setup
env:
VERSION: ${{ needs.setup.outputs.VERSION }}
CHROME: ${{ needs.setup.outputs.CHROME }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Make Chrome Manifest
run: deno run dev-chrome
- name: Zip Chrome extension
run: zip -r dist/$CHROME-v$VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Chrome artifact
uses: actions/upload-artifact@v3
with:
name: $CHROME-v$VERSION
path: dist/$CHROME-v$VERSION.zip
firefox:
runs-on: ubuntu-latest
needs: chrome
env:
VERSION: ${{ needs.setup.outputs.VERSION }}
FIREFOX: ${{ needs.setup.outputs.FIREFOX }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Make Firefox Manifest
run: deno run dev-firefox
- name: Zip Firefox extension
run: zip -r dist/$FIREFOX-v$VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Firefox artifact
uses: actions/upload-artifact@v3
with:
name: $FIREFOX-v$VERSION
path: dist/$FIREFOX-v$VERSION.zip
safari:
runs-on: ubuntu-latest
needs: firefox
env:
VERSION: ${{ needs.setup.outputs.VERSION }}
SAFARI: ${{ needs.setup.outputs.SAFARI }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Make Safari Manifest
run: deno run dev-safari
- name: Zip Safari extension
run: zip -r dist/$SAFARI-v$VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Safari artifact
uses: actions/upload-artifact@v3
with:
name: $SAFARI-v$VERSION
path: dist/$SAFARI-v$VERSION.zip