forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (86 loc) · 3.28 KB
/
snapshot.yml
File metadata and controls
99 lines (86 loc) · 3.28 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
98
99
name: snapshot
on:
workflow_dispatch:
workflow_run:
workflows: ["test"]
types:
- completed
branches:
- integration
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
jobs:
publish:
runs-on: blacksmith-4vcpu-ubuntu-2404
# Only run if tests passed (workflow_run) or manual dispatch ON INTEGRATION BRANCH
# Also skip release commits to prevent infinite loop
if: |
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/integration') ||
(github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
!startsWith(github.event.workflow_run.head_commit.message, 'release:') &&
!startsWith(github.event.workflow_run.head_commit.message, 'chore:'))
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
# Checkout the branch by name so git branch --show-current works
# For workflow_run, use head_branch; for workflow_dispatch, use ref
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: ">=1.24.0"
cache: true
cache-dependency-path: go.sum
- uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- uses: ./.github/actions/setup-bun
- name: Configure Git
run: |
git config --global user.email "shuvcode@latitudes.dev"
git config --global user.name "shuvcode"
- name: Publish
id: publish
run: |
./script/publish.ts
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Release (undraft)
if: success() && steps.publish.outputs.tagName
run: gh release edit ${{ steps.publish.outputs.tagName }} --draft=false
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Post to Discord
if: success() && steps.publish.outputs.tagName
continue-on-error: true
run: ./script/discord-notify.ts
env:
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_THREAD_ID: ${{ secrets.DISCORD_THREAD_ID }}
RELEASE_VERSION: ${{ steps.publish.outputs.tagName }}
RELEASE_CHANGELOG: ${{ steps.publish.outputs.changelog }}
- name: Deploy Desktop to Cloudflare
continue-on-error: true
run: |
bunx sst deploy --stage production --config sst.desktop.config.ts
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_DEFAULT_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy Share to Cloudflare
continue-on-error: true
run: |
bunx sst deploy --stage production --config sst.share.config.ts
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_DEFAULT_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}