Workflow file for this run
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: Build and Package Browser Extension | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build Project | |
| run: npm run build | |
| - name: Restore Private Key | |
| run: echo "${{ secrets.EXTENSION_PRIVATE_KEY }}" > extension.pem | |
| - name: Package Chrome Extension as CRX | |
| run: | | |
| google-chrome --pack-extension=$(pwd)/dist --pack-extension-key=$(pwd)/extension.pem | |
| - name: Rename and Move CRX | |
| id: make_release_files | |
| run: | | |
| mkdir -p release | |
| mv *.crx release/oasis-proxy-extension.crx | |
| cd dist | |
| zip -r ../release/oasis-proxy-extension.zip . | |
| echo "The latest tag is ${{ github.ref }}" | |
| echo "TAG_NAME=$(echo ${{ github.ref }} | awk -F '/' '{print $3}')" >> $GITHUB_OUTPUT | |
| - name: Upload Artifact (ZIP) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: oasisproxy-extension | |
| path: release/ | |
| - name: release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ steps.make_release_files.outputs.TAG_NAME }} | |
| name: ${{ format('Oasis-Proxy-{0}', steps.make_release_files.outputs.TAG_NAME) }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| artifacts: 'release/*' |