Skip to content

chore(.gitignore): remove package-lock.json from ignored files to all… #2

chore(.gitignore): remove package-lock.json from ignored files to all…

chore(.gitignore): remove package-lock.json from ignored files to all… #2

Workflow file for this run

env:
DIRECTORY: .
PROJECT_NAME: extension
name: Release
on:
push:
branches:
- main
jobs:
Version:
outputs:
created: ${{ env.DAILY_VERSION_CREATED }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm
- run: npm ci
- name: Test and build
run: npm test
- name: Create tag if necessary
uses: fregante/daily-version-action@v2
- name: Update manifest.json with version ${{ env.DAILY_VERSION}}
if: env.DAILY_VERSION_CREATED
run: npx dot-json@1 "$DIRECTORY/manifest.json" version "$DAILY_VERSION"
- name: Update package.json with version ${{ env.DAILY_VERSION}}
if: env.DAILY_VERSION_CREATED
run: npx dot-json@1 "$DIRECTORY/package.json" version "$DAILY_VERSION"
- name: Ready for "submit" jobs
if: env.DAILY_VERSION_CREATED
uses: actions/upload-artifact@v4
with:
path: ${{ env.DIRECTORY }}
- name: Create release
if: env.DAILY_VERSION_CREATED
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ env.DIRECTORY }}
run: |
FILENAME="$PROJECT_NAME-$DAILY_VERSION-for-local-testing-only.zip"
zip -r "$FILENAME" ./*
gh release create "$DAILY_VERSION" --generate-notes "$FILENAME"
Chrome:
if: needs.Version.outputs.created
needs: Version
name: Submit (Chrome)
environment: Chrome
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- run: npx chrome-webstore-upload-cli@3
working-directory: artifact
env:
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
Firefox:
if: needs.Version.outputs.created
needs: Version
name: Submit (Firefox)
environment: Firefox
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: git archive --output source.zip HEAD ":!test" ":!.github" && unzip -l source.zip
- run: npx web-ext@8 sign --channel listed --upload-source-code ../source.zip
working-directory: artifact
env:
WEB_EXT_API_KEY: ${{ secrets.FIREFOX_JWT_ISSUER }}
WEB_EXT_API_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}