|
| 1 | +name: release-complete |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: ['v*'] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-all-platforms: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + branch: [master, firefox] |
| 17 | + steps: |
| 18 | + - name: Checkout ${{ matrix.branch }} |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + ref: ${{ matrix.branch }} |
| 22 | + |
| 23 | + - name: Determine manifest version |
| 24 | + id: manifest |
| 25 | + run: | |
| 26 | + VERSION=$(jq -r '.version // "0.0.0"' manifest.json) |
| 27 | + echo "version=$VERSION" >> "$GITHUB_OUTPUT" |
| 28 | +
|
| 29 | + - name: Determine platform |
| 30 | + id: platform |
| 31 | + run: | |
| 32 | + if [[ "${{ matrix.branch }}" == "firefox" ]]; then |
| 33 | + echo "suffix=firefox" >> "$GITHUB_OUTPUT" |
| 34 | + else |
| 35 | + echo "suffix=chrome" >> "$GITHUB_OUTPUT" |
| 36 | + fi |
| 37 | +
|
| 38 | + - name: Create extension zip |
| 39 | + id: ext_zip |
| 40 | + run: | |
| 41 | + VERSION="${{ steps.manifest.outputs.version }}" |
| 42 | + SUFFIX="${{ steps.platform.outputs.suffix }}" |
| 43 | + ARCHIVE_NAME="slactac_${SUFFIX}-v${VERSION}.zip" |
| 44 | + zip -r "$ARCHIVE_NAME" \ |
| 45 | + manifest.json \ |
| 46 | + content.js \ |
| 47 | + popup.js \ |
| 48 | + popup.html \ |
| 49 | + popup.css \ |
| 50 | + storage.js \ |
| 51 | + icons \ |
| 52 | + compat.js |
| 53 | + echo "archive=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" |
| 54 | +
|
| 55 | + - name: Upload extension artifact |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: slactac-${{ steps.platform.outputs.suffix }}-${{ steps.manifest.outputs.version }} |
| 59 | + path: ${{ steps.ext_zip.outputs.archive }} |
| 60 | + |
| 61 | + create-source-and-release: |
| 62 | + needs: build-all-platforms |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - name: Checkout repository |
| 66 | + uses: actions/checkout@v4 |
| 67 | + with: |
| 68 | + fetch-depth: 0 |
| 69 | + |
| 70 | + - name: Get version |
| 71 | + id: version |
| 72 | + run: | |
| 73 | + VERSION=$(jq -r '.version // "0.0.0"' manifest.json) |
| 74 | + echo "version=$VERSION" >> "$GITHUB_OUTPUT" |
| 75 | +
|
| 76 | + - name: Download all artifacts |
| 77 | + uses: actions/download-artifact@v4 |
| 78 | + with: |
| 79 | + path: artifacts |
| 80 | + |
| 81 | + - name: Create source code archives |
| 82 | + run: | |
| 83 | + # Create source code zip |
| 84 | + zip -r slactac-source-v${{ steps.version.outputs.version }}.zip \ |
| 85 | + -x ".git*" "node_modules/*" "artifacts/*" ".github/workflows/*" \ |
| 86 | + . |
| 87 | + |
| 88 | + # Create source code tar.gz |
| 89 | + tar --exclude='.git' \ |
| 90 | + --exclude='node_modules' \ |
| 91 | + --exclude='artifacts' \ |
| 92 | + --exclude='.github/workflows' \ |
| 93 | + -czf slactac-source-v${{ steps.version.outputs.version }}.tar.gz . |
| 94 | +
|
| 95 | + - name: Flatten artifacts |
| 96 | + run: | |
| 97 | + find artifacts -type f -name "*.zip" -exec cp {} . \; |
| 98 | +
|
| 99 | + - name: Create release with all assets |
| 100 | + uses: softprops/action-gh-release@v2 |
| 101 | + with: |
| 102 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 103 | + tag_name: v${{ steps.version.outputs.version }} |
| 104 | + name: Slactac v${{ steps.version.outputs.version }} |
| 105 | + body: | |
| 106 | + Bump to v${{ steps.version.outputs.version }} - Add renamed channel yellow highlighting feature |
| 107 | +
|
| 108 | + - Channels already renamed now shine with gruvbox yellow in picker mode |
| 109 | + - Only shows yellow highlight while Pick Channel tool is active |
| 110 | + - Applies to both Chrome and Firefox versions |
| 111 | + files: | |
| 112 | + slactac_chrome-v*.zip |
| 113 | + slactac_firefox-v*.zip |
| 114 | + slactac-source-v*.zip |
| 115 | + slactac-source-v*.tar.gz |
| 116 | + draft: false |
0 commit comments