|
1 | | -name: Build and Release |
2 | | - |
| 1 | +name: Release |
3 | 2 | on: |
4 | | - push: |
5 | | - tags: |
6 | | - - "v*" |
7 | | - workflow_dispatch: |
8 | | - |
| 3 | + workflow_dispatch: {} |
9 | 4 | jobs: |
10 | | - build: |
11 | | - runs-on: ubuntu-latest |
12 | | - strategy: |
13 | | - matrix: |
14 | | - include: |
15 | | - - target: bun-windows-x64 |
16 | | - artifact: inspectarr-windows-x64.exe |
17 | | - - target: bun-darwin-x64 |
18 | | - artifact: inspectarr-macos-x64 |
19 | | - - target: bun-darwin-arm64 |
20 | | - artifact: inspectarr-macos-arm64 |
21 | | - - target: bun-linux-x64-musl |
22 | | - artifact: inspectarr-linux-x64 |
23 | | - - target: bun-linux-arm64-musl |
24 | | - artifact: inspectarr-linux-arm64 |
25 | | - |
26 | | - steps: |
27 | | - - name: Checkout |
28 | | - uses: actions/checkout@v5 |
29 | | - |
30 | | - - name: Setup Bun |
31 | | - uses: oven-sh/setup-bun@v2 |
32 | | - with: |
33 | | - bun-version: latest |
34 | | - |
35 | | - - name: Install dependencies |
36 | | - run: bun install --production |
37 | | - |
38 | | - - name: Build binary |
39 | | - run: bun build --compile --sourcemap --target=${{ matrix.target }} --outfile=${{ matrix.artifact }} src/index.ts |
40 | | - |
41 | | - - name: Upload artifact |
42 | | - uses: actions/upload-artifact@v4 |
43 | | - with: |
44 | | - name: ${{ matrix.artifact }} |
45 | | - path: ${{ matrix.artifact }} |
46 | | - |
47 | 5 | release: |
48 | | - needs: build |
49 | | - # if: github.ref_type == 'tag' |
50 | | - runs-on: ubuntu-latest |
51 | 6 | permissions: |
52 | 7 | contents: write |
53 | | - |
54 | | - steps: |
55 | | - - name: Checkout |
56 | | - uses: actions/checkout@v5 |
57 | | - |
58 | | - - name: Setup Bun |
59 | | - uses: oven-sh/setup-bun@v2 |
60 | | - with: |
61 | | - bun-version: latest |
62 | | - |
63 | | - - name: Download all artifacts |
64 | | - uses: actions/download-artifact@v4 |
65 | | - with: |
66 | | - path: ./artifacts |
67 | | - |
68 | | - - name: Release |
69 | | - uses: softprops/action-gh-release@v2 |
70 | | - with: |
71 | | - files: | |
72 | | - ./artifacts/inspectarr-windows-x64.exe/inspectarr-windows-x64.exe |
73 | | - ./artifacts/inspectarr-macos-x64/inspectarr-macos-x64 |
74 | | - ./artifacts/inspectarr-macos-arm64/inspectarr-macos-arm64 |
75 | | - ./artifacts/inspectarr-linux-x64/inspectarr-linux-x64 |
76 | | - ./artifacts/inspectarr-linux-arm64/inspectarr-linux-arm64 |
77 | | -
|
78 | | - - name: Process package templates |
79 | | - run: | |
80 | | - bun ./package_templates/template-processor.ts "${GITHUB_REF_NAME#v}" |
81 | | -
|
82 | | - - name: Set up git |
83 | | - run: | |
84 | | - git config --global user.email adamhl@pm.me |
85 | | - git config --global user.name "GitHub Actions" |
86 | | -
|
87 | | - - name: Update homebrew tap |
88 | | - env: |
89 | | - INSPECTARR_PACKAGE_TOKEN: ${{ secrets.INSPECTARR_PACKAGE_TOKEN }} |
90 | | - run: | |
91 | | - REPO="https://adamhl8:${INSPECTARR_PACKAGE_TOKEN}@github.com/adamhl8/homebrew-inspectarr.git" |
92 | | - CLONE_DIR=$(mktemp -d) |
93 | | - git clone --depth 1 "${REPO}" "${CLONE_DIR}" |
94 | | - cp ./package_templates/homebrew/inspectarr.rb "${CLONE_DIR}/Formula/inspectarr.rb" |
95 | | - cd "${CLONE_DIR}" |
96 | | - git add -A |
97 | | - git commit -m "${{ github.ref_name }}" |
98 | | - git push "${REPO}" |
99 | | -
|
100 | | - - name: Update scoop bucket |
101 | | - env: |
102 | | - INSPECTARR_PACKAGE_TOKEN: ${{ secrets.INSPECTARR_PACKAGE_TOKEN }} |
103 | | - run: | |
104 | | - REPO="https://adamhl8:${INSPECTARR_PACKAGE_TOKEN}@github.com/adamhl8/scoop-inspectarr.git" |
105 | | - CLONE_DIR=$(mktemp -d) |
106 | | - git clone --depth 1 "${REPO}" "${CLONE_DIR}" |
107 | | - cp ./package_templates/scoop/inspectarr.json "${CLONE_DIR}/inspectarr.json" |
108 | | - cd "${CLONE_DIR}" |
109 | | - git add -A |
110 | | - git commit -m "${{ github.ref_name }}" |
111 | | - git push "${REPO}" |
| 8 | + uses: adamhl8/configs/.github/workflows/release.yml@main |
| 9 | + secrets: inherit |
0 commit comments