chore: added safari build #75
This file contains hidden or 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: Version | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| skip_release: | |
| description: "Skip GitHub release creation and only run store submit logic" | |
| type: boolean | |
| required: false | |
| default: false | |
| force_submit: | |
| description: "Force submit to stores even if changesets did not publish this run" | |
| type: boolean | |
| required: false | |
| default: false | |
| jobs: | |
| version: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.bun/install/cache | |
| node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build & Zip | |
| run: | | |
| bun run zip | |
| bun run zip:firefox | |
| - name: Create Release Pull Request | |
| id: changesets | |
| if: github.event_name != 'workflow_dispatch' || !inputs.force_submit | |
| uses: changesets/action@v1 | |
| with: | |
| version: bun run version | |
| publish: bun run release | |
| createGithubReleases: false | |
| commit: "chore: version packages" | |
| title: "chore: version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release Assets with Versioning | |
| id: version | |
| if: steps.changesets.outputs.published == 'true' | |
| run: | | |
| PACKAGES='${{ steps.changesets.outputs.publishedPackages }}' | |
| VERSION=v$(echo "$PACKAGES" | jq -r '.[] | select(.name == "OTTPRO") | .version') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "OTTPRO version: $VERSION" | |
| - name: Create release | |
| if: steps.changesets.outputs.published == 'true' && (github.event_name != 'workflow_dispatch' || !inputs.skip_release) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.version }} | |
| files: | | |
| .output/*-firefox.zip | |
| .output/*-chrome.zip | |
| append_body: true | |
| body: | | |
| ### Installation | |
| 1. Download the appropriate zip file for your browser | |
| 2. Extract the contents | |
| 3. Load as unpacked extension in developer mode | |
| For detailed installation instructions, visit our [documentation](https://ottpro.winoffrg.dev/). | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Submit to stores | |
| if: steps.changesets.outputs.published == 'true' || (github.event_name == 'workflow_dispatch' && inputs.force_submit) | |
| run: | | |
| bun wxt submit \ | |
| --chrome-zip .output/*-chrome.zip \ | |
| --chrome-skip-submit-review \ | |
| --firefox-zip .output/*-firefox.zip \ | |
| --firefox-sources-zip .output/*-sources.zip | |
| env: | |
| CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }} | |
| CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }} | |
| CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }} | |
| CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }} | |
| CHROME_PUBLISH_TARGET: ${{ secrets.CHROME_PUBLISH_TARGET }} | |
| CHROME_SKIP_SUBMIT_REVIEW: ${{ secrets.CHROME_SKIP_SUBMIT_REVIEW }} | |
| FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} | |
| FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }} | |
| FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }} |