Skip to content

Commit 123061e

Browse files
abueideclaude
andauthored
fix: split release workflow into beta and production environments (#1228)
Separate release jobs by type to use different GitHub environments: - Beta releases: Use "Publish-Beta" (no approval required for org members) - Production releases: Use "Publish" (requires reviewer approval) - Dry-run: No environment (no publishing) This allows Segment org team members to self-publish beta releases for testing while maintaining secondary approval for production releases. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a42fa51 commit 123061e

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
- name: Test
3838
run: devbox run test
3939

40-
release:
41-
name: Release (${{ inputs.type }})
40+
release-dryrun:
41+
name: Release (dry-run)
42+
if: inputs.type == 'dry-run'
4243
needs: [ci]
4344
runs-on: ubuntu-latest
44-
environment: Publish
4545
permissions:
4646
contents: write
4747
issues: write
@@ -57,25 +57,61 @@ jobs:
5757
uses: jetify-com/devbox-install-action@v0.14.0
5858

5959
- name: Release (dry-run)
60-
if: inputs.type == 'dry-run'
6160
run: devbox run release-dry-run
6261
env:
6362
GH_TOKEN: ${{ github.token }}
6463

64+
release-beta:
65+
name: Release (beta)
66+
if: inputs.type == 'beta'
67+
needs: [ci]
68+
runs-on: ubuntu-latest
69+
environment: Publish-Beta
70+
permissions:
71+
contents: write
72+
issues: write
73+
pull-requests: write
74+
id-token: write
75+
steps:
76+
- uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
token: ${{ github.token }}
80+
81+
- name: Install devbox
82+
uses: jetify-com/devbox-install-action@v0.14.0
83+
6584
- name: Release (beta)
66-
if: inputs.type == 'beta'
6785
run: |
6886
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
6987
devbox run -e GITHUB_REF=refs/heads/$BRANCH_NAME release
7088
env:
7189
GH_TOKEN: ${{ github.token }}
7290

91+
release-production:
92+
name: Release (production)
93+
if: inputs.type == 'production'
94+
needs: [ci]
95+
runs-on: ubuntu-latest
96+
environment: Publish
97+
permissions:
98+
contents: write
99+
issues: write
100+
pull-requests: write
101+
id-token: write
102+
steps:
103+
- uses: actions/checkout@v4
104+
with:
105+
fetch-depth: 0
106+
token: ${{ github.token }}
107+
108+
- name: Install devbox
109+
uses: jetify-com/devbox-install-action@v0.14.0
110+
73111
- name: Release (production)
74-
if: inputs.type == 'production'
75112
run: devbox run release
76113
env:
77114
GH_TOKEN: ${{ github.token }}
78115

79116
- name: Update Apps
80-
if: inputs.type == 'production'
81117
run: devbox run update-apps

0 commit comments

Comments
 (0)