release #54
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: release | |
on: | |
workflow_dispatch: | |
inputs: | |
retry-version: | |
type: string | |
description: Retry version | |
required: false | |
retry-chrome: | |
type: boolean | |
description: Retry Chrome release (Requires retry version) | |
required: false | |
default: false | |
retry-firefox: | |
type: boolean | |
description: Retry Firefox release (Requires retry version) | |
required: false | |
default: false | |
dry-run: | |
type: boolean | |
description: Run without releasing | |
required: false | |
default: false | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- run: npm ci | |
- run: npx biome ci . | |
types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- run: npm ci | |
- run: npm run types | |
build-chrome: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- run: npm ci | |
- run: npm run build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist-chrome | |
path: dist | |
build-firefox: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- run: npm ci | |
- run: npm run build:firefox | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist-firefox | |
path: dist | |
version: | |
needs: [lint, types, build-chrome, build-firefox] | |
outputs: | |
manifest_version: ${{ env.DAILY_VERSION }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- if: ${{ inputs.dry-run == false && ! inputs.retry-version }} | |
uses: fregante/daily-version-action@v2 | |
- if: ${{ inputs.retry-version }} | |
run: echo "DAILY_VERSION=${{ inputs.retry-version }}" >> "$GITHUB_ENV" | |
- if: ${{ inputs.dry-run == true && ! inputs.retry-version }} | |
run: echo "DAILY_VERSION=dry_run" >> "$GITHUB_ENV" | |
- if: env.DAILY_VERSION_CREATED | |
run: gh release create "$DAILY_VERSION" --generate-notes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release-chrome: | |
needs: version | |
if: ${{ needs.version.outputs.manifest_version && (! inputs.retry-version || inputs.retry-version && inputs.retry-chrome) }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- run: npm ci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist-chrome | |
path: dist | |
- run: ls -R | |
working-directory: dist | |
- run: npm run manifest:version -- "${{ needs.version.outputs.manifest_version }}" | |
- if: ${{ inputs.dry-run == false }} | |
run: npm run release | |
env: | |
EXTENSION_ID: ${{ secrets.EXTENSION_ID }} | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | |
- if: ${{ inputs.dry-run == false }} | |
run: | | |
FILENAME="skinport-plus-chrome-${{ needs.version.outputs.manifest_version }}.zip" | |
zip -r "$FILENAME" ./* | |
gh release upload "${{ needs.version.outputs.manifest_version }}" "$FILENAME" | |
working-directory: dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release-firefox: | |
needs: version | |
if: ${{ needs.version.outputs.manifest_version && (! inputs.retry-version || inputs.retry-version && inputs.retry-firefox) }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- run: npm ci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist-firefox | |
path: dist | |
- run: ls -R | |
working-directory: dist | |
- run: npm run manifest:version -- "${{ needs.version.outputs.manifest_version }}" | |
- if: ${{ inputs.dry-run == false }} | |
run: npm run release:firefox | |
env: | |
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} | |
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} | |
- if: ${{ inputs.dry-run == false }} | |
run: | | |
FILENAME="skinport-plus-firefox-${{ needs.version.outputs.manifest_version }}.zip" | |
zip -r "$FILENAME" ./* | |
gh release upload "${{ needs.version.outputs.manifest_version }}" "$FILENAME" | |
working-directory: dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |