name: CI on: push: tags: - 'v*' jobs: build: runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} steps: - name: Check out repository uses: actions/checkout@v4.1.2 - name: Read package version uses: tyankatsu0105/read-package-version-actions@v1 id: version - name: Install dependencies run: bun install - name: Test UserScript build run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=1 --define __ENV_WEBEXTENSION=0 - name: Test WebExtension build run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=0 --define __ENV_WEBEXTENSION=1 - name: Build project run: bun run build --mode production - name: Archive production artifacts uses: actions/upload-artifact@v3 with: name: tf2wikipricing path: dist/ deploy: runs-on: ubuntu-latest needs: build steps: - name: Download release artifacts uses: actions/download-artifact@v3 with: name: tf2wikipricing path: dist/ - name: Package Chrome extension run: | cd dist/ echo "${{ secrets.CRX_PRIVATE_KEY }}" > private.pem bun x crx pack -p private.pem -o tf2wikipricing.crx extension/ rm -f private.pem - name: Create release id: use-go-action uses: akkuman/gitea-release-action@v1 with: title: "v${{ need.build.outputs.version }}" name: "v${{ need.build.outputs.version }}" files: | dist/tf2wikipricing.crx dist/userscript/tf2wikipricing.user.js sha256sum: true