|
7 | 7 | contents: write |
8 | 8 | uses: adamhl8/configs/.github/workflows/release.yml@main |
9 | 9 | secrets: inherit |
| 10 | + |
| 11 | + tag: |
| 12 | + needs: release |
| 13 | + runs-on: ubuntu-latest |
| 14 | + outputs: |
| 15 | + tag: ${{ steps.tag.outputs.tag }} |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v7 |
| 19 | + with: |
| 20 | + ref: main |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Get release tag |
| 24 | + id: tag |
| 25 | + run: echo "tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT" |
| 26 | + |
| 27 | + build: |
| 28 | + needs: tag |
| 29 | + runs-on: ubuntu-latest |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + include: |
| 33 | + - target: x86_64-pc-windows-msvc |
| 34 | + binary: inspectarr.exe |
| 35 | + artifact: inspectarr-windows-x64.exe |
| 36 | + - target: x86_64-apple-darwin |
| 37 | + binary: inspectarr |
| 38 | + artifact: inspectarr-macos-x64 |
| 39 | + - target: aarch64-apple-darwin |
| 40 | + binary: inspectarr |
| 41 | + artifact: inspectarr-macos-arm64 |
| 42 | + - target: x86_64-unknown-linux-gnu |
| 43 | + binary: inspectarr |
| 44 | + artifact: inspectarr-linux-x64 |
| 45 | + - target: aarch64-unknown-linux-gnu |
| 46 | + binary: inspectarr |
| 47 | + artifact: inspectarr-linux-arm64 |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Checkout |
| 51 | + uses: actions/checkout@v7 |
| 52 | + with: |
| 53 | + ref: ${{ needs.tag.outputs.tag }} |
| 54 | + |
| 55 | + - name: Set up nub |
| 56 | + uses: nubjs/setup-nub@v0 |
| 57 | + with: |
| 58 | + node-version: "26" |
| 59 | + |
| 60 | + - name: Install |
| 61 | + run: nub i --ignore-scripts |
| 62 | + |
| 63 | + - name: Set up Deno |
| 64 | + uses: denoland/setup-deno@v2 |
| 65 | + with: |
| 66 | + deno-version: latest |
| 67 | + |
| 68 | + - name: Build binary |
| 69 | + run: deno compile -A --node-modules-dir=manual --bundle --minify --target=${{ matrix.target }} -o inspectarr src/index.ts |
| 70 | + |
| 71 | + - name: Rename binary |
| 72 | + run: mv ${{ matrix.binary }} ${{ matrix.artifact }} |
| 73 | + |
| 74 | + - name: Upload artifact |
| 75 | + uses: actions/upload-artifact@v7 |
| 76 | + with: |
| 77 | + name: ${{ matrix.artifact }} |
| 78 | + path: ${{ matrix.artifact }} |
| 79 | + |
| 80 | + publish: |
| 81 | + needs: [tag, build] |
| 82 | + runs-on: ubuntu-latest |
| 83 | + permissions: |
| 84 | + contents: write |
| 85 | + env: |
| 86 | + TAG: ${{ needs.tag.outputs.tag }} |
| 87 | + |
| 88 | + steps: |
| 89 | + - name: Checkout |
| 90 | + uses: actions/checkout@v7 |
| 91 | + with: |
| 92 | + ref: ${{ needs.tag.outputs.tag }} |
| 93 | + |
| 94 | + - name: Set up nub |
| 95 | + uses: nubjs/setup-nub@v0 |
| 96 | + with: |
| 97 | + node-version: "26" |
| 98 | + |
| 99 | + - name: Install |
| 100 | + run: nub i --ignore-scripts |
| 101 | + |
| 102 | + - name: Download all artifacts |
| 103 | + uses: actions/download-artifact@v8 |
| 104 | + with: |
| 105 | + path: ./artifacts |
| 106 | + merge-multiple: true |
| 107 | + |
| 108 | + - name: Attach binaries to release |
| 109 | + env: |
| 110 | + GH_TOKEN: ${{ github.token }} |
| 111 | + run: gh release upload "${TAG}" ./artifacts/* --clobber |
| 112 | + |
| 113 | + - name: Process package templates |
| 114 | + run: | |
| 115 | + nub ./package_templates/template-processor.ts "${TAG#v}" |
| 116 | +
|
| 117 | + - name: Set up git |
| 118 | + run: | |
| 119 | + git config --global user.email adamhl@pm.me |
| 120 | + git config --global user.name "GitHub Actions" |
| 121 | +
|
| 122 | + - name: Update homebrew tap |
| 123 | + env: |
| 124 | + INSPECTARR_PACKAGE_TOKEN: ${{ secrets.INSPECTARR_PACKAGE_TOKEN }} |
| 125 | + run: | |
| 126 | + REPO="https://adamhl8:${INSPECTARR_PACKAGE_TOKEN}@github.com/adamhl8/homebrew-inspectarr.git" |
| 127 | + CLONE_DIR=$(mktemp -d) |
| 128 | + git clone --depth 1 "${REPO}" "${CLONE_DIR}" |
| 129 | + cp ./package_templates/homebrew/inspectarr.rb "${CLONE_DIR}/Formula/inspectarr.rb" |
| 130 | + cd "${CLONE_DIR}" |
| 131 | + git add -A |
| 132 | + git commit -m "${TAG}" |
| 133 | + git push "${REPO}" |
| 134 | +
|
| 135 | + - name: Update scoop bucket |
| 136 | + env: |
| 137 | + INSPECTARR_PACKAGE_TOKEN: ${{ secrets.INSPECTARR_PACKAGE_TOKEN }} |
| 138 | + run: | |
| 139 | + REPO="https://adamhl8:${INSPECTARR_PACKAGE_TOKEN}@github.com/adamhl8/scoop-inspectarr.git" |
| 140 | + CLONE_DIR=$(mktemp -d) |
| 141 | + git clone --depth 1 "${REPO}" "${CLONE_DIR}" |
| 142 | + cp ./package_templates/scoop/inspectarr.json "${CLONE_DIR}/inspectarr.json" |
| 143 | + cd "${CLONE_DIR}" |
| 144 | + git add -A |
| 145 | + git commit -m "${TAG}" |
| 146 | + git push "${REPO}" |
0 commit comments