Merge pull request #18 from clFaster/feature/update-readme #45
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 TapToQR Artifact" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| VERSION: | |
| description: "The version of the addon to build" | |
| type: string | |
| required: false | |
| workflow_call: | |
| inputs: | |
| VERSION: | |
| description: "The version of the addon to build" | |
| type: string | |
| required: false | |
| outputs: | |
| VERSION: | |
| description: "The version of the addon to build" | |
| value: ${{ jobs.build-artifact.outputs.VERSION }} | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && 'pull_request' || 'push' }}-${{ github.event.pull_request.number || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-artifact: | |
| name: "Build TapToQR Artifact" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| VERSION: ${{ steps.determine-version.outputs.VERSION }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Determine VERSION | |
| id: determine-version | |
| run: | | |
| if [ -z "${{ inputs.VERSION }}" ]; then | |
| echo "Using repository version" | |
| echo ${{ vars.VERSION }} | |
| echo "VERSION=${{ vars.VERSION }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "Using input version" | |
| echo ${{ inputs.VERSION }} | |
| echo "VERSION=${{ inputs.VERSION }}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Update Version | |
| working-directory: ./browser | |
| run: | | |
| jq --arg version "${{steps.determine-version.outputs.VERSION}}" '.version = $version' package.json > temp.json && mv temp.json package.json | |
| jq --arg version "${{steps.determine-version.outputs.VERSION}}" '.version = $version' public/manifest.json > public/temp.json && mv public/temp.json public/manifest.json | |
| - name: Install dependencies | |
| working-directory: ./browser | |
| run: npm install | |
| - name: Lint code | |
| working-directory: ./browser | |
| run: npm run lint | |
| - name: Build extension | |
| working-directory: ./browser | |
| run: npm run build | |
| - name: Create Artifact | |
| working-directory: ./browser/build | |
| run: | | |
| zip -r ../../TapToQR-${{steps.determine-version.outputs.VERSION}}.zip ./* | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: 'TapToQR-${{steps.determine-version.outputs.VERSION}}.zip' | |
| name: 'TapToQR-addon' |