Repository navigation
97 lines (80 loc) · 2.65 KB
/
Copy pathrelease.yml
File metadata and controls
97 lines (80 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
workflow_dispatch:
permissions:
contents: write
env:
HUSKY: 0
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Check out main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Set up project tools
uses: jdx/mise-action@v4
with:
version: 2026.8.6
- name: Cache dependencies and Go builds
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-dependencies-${{ hashFiles('mise.toml', '.node-version', 'package.json', 'pnpm-lock.yaml', 'go.sum') }}
restore-keys: ${{ runner.os }}-dependencies-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Select release version
id: version
env:
GH_TOKEN: ${{ github.token }}
run: mise run release:select-version
- name: Verify release
run: mise run check:ci
- name: Create release tag
if: steps.version.outputs.tag_exists != 'true'
env:
RELEASE_TAG: ${{ steps.version.outputs.tag }}
run: mise run release:tag
- name: Publish GitHub release
if: steps.version.outputs.release_exists != 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: mise run release:publish
- name: Download existing release
if: steps.version.outputs.release_exists == 'true'
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.version.outputs.tag }}
run: mise run release:download
- name: Check out Homebrew tap
uses: actions/checkout@v4
with:
repository: flexdinesh/homebrew-tap
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-tap
fetch-depth: 0
- name: Generate Homebrew formula
run: |
pnpm generate:homebrew -- \
--version "${{ steps.version.outputs.number }}" \
--tag "${{ steps.version.outputs.tag }}" \
--checksums dist/checksums.txt \
--output homebrew-tap/Formula/diffx.rb
- name: Validate Homebrew formula syntax
run: mise run release:homebrew:check
- name: Open Homebrew tap pull request
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
RELEASE_VERSION: ${{ steps.version.outputs.number }}
RELEASE_TAG: ${{ steps.version.outputs.tag }}
run: mise run release:homebrew:pr