Skip to content

added dist directory #14

added dist directory

added dist directory #14

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:
DIRECTORY: ${{ steps.make_dir.outputs.DIST }}
CHROME_VERSION: ${{ steps.def_file_name.outputs.CHROME_VERSION }}
FIREFOX_VERSION: ${{ steps.def_file_name.outputs.FIREFOX_VERSION }}
SAFARI_VERSION: ${{ steps.def_file_name.outputs.SAFARI_VERSION }}
steps:
- name: Define prefix
run: echo "AWSF=awsf" >> $GITHUB_ENV
- name: Define file names no version
run: |
echo "CHROME=${{ env.AWSF }}-chrome" >> $GITHUB_ENV
echo "FIREFOX=${{ env.AWSF }}-firefox" >> $GITHUB_ENV
echo "SAFARI=${{ env.AWSF }}-safari" >> $GITHUB_ENV
- name: Setup repo
uses: actions/checkout@v4
- name: Extract current version
run: |
VERSION=$(grep -oP '"version":\s*"\K[0-9.]+' manifest/template-manifest.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create versioned directory
id: make_dir
run: |
echo "DIST=dist/v${{ env.VERSION }}" >> $GITHUB_OUTPUT
mkdir -p $DIST
- name: Define file names with version
id: def_file_name
run: |
echo "CHROME_VERSION=${{ env.CHROME }}-v${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "FIREFOX_VERSION=${{ env.FIREFOX }}-v${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "SAFARI_VERSION=${{ env.SAFARI }}-v${{ env.VERSION }}" >> $GITHUB_OUTPUT
chrome:
runs-on: ubuntu-latest
needs: setup
env:
DIRECTORY: ${{ needs.setup.outputs.DIRECTORY }}
CHROME_VERSION: ${{ needs.setup.outputs.CHROME_VERSION }}
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 $DIRECTORY/$CHROME_VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Chrome artifact
uses: actions/upload-artifact@v3
with:
name: $CHROME_VERSION
path: $DIRECTORY/$CHROME_VERSION.zip
firefox:
runs-on: ubuntu-latest
needs: chrome
env:
DIRECTORY: ${{ needs.setup.outputs.DIRECTORY }}
FIREFOX_VERSION: ${{ needs.setup.outputs.FIREFOX_VERSION }}
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 $DIRECTORY/$FIREFOX_VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Firefox artifact
uses: actions/upload-artifact@v3
with:
name: $FIREFOX_VERSION
path: $DIRECTORY/$FIREFOX_VERSION.zip
safari:
runs-on: ubuntu-latest
needs: firefox
env:
DIRECTORY: ${{ needs.setup.outputs.DIRECTORY }}
SAFARI_VERSION: ${{ needs.setup.outputs.SAFARI_VERSION }}
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 $DIRECTORY/$SAFARI_VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Safari artifact
uses: actions/upload-artifact@v3
with:
name: $SAFARI_VERSION
path: $DIRECTORY/$SAFARI_VERSION.zip