-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (111 loc) · 3.99 KB
/
release-pull-request.yaml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# DO NOT EDIT!
# This file was autogenerated by Carson.
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
#
# Run `npx carson update workspace` to regenerate.
#
name: Release pull request
on:
pull_request:
branches:
- development
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release_pull_request:
name: Release pull request
if: ${{ github.actor != 'renovate[bot]' && !contains(github.head_ref, 'renovate/') }}
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Configure git
run: |
git config user.email "bot@mazanec.dev"
git config user.name "Bot"
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- uses: superfly/flyctl-actions/setup-flyctl@master
- uses: edgedb/setup-edgedb@v1
with:
server-version: none
- name: Install packages
run: npm ci
- name: Check for changes
run: |
git config core.filemode false
git_status=$(git status --porcelain)
if [[ -n $git_status ]]; then
echo "You have uncommitted changes!"
git diff
git config --unset core.filemode
exit 1
fi
git config --unset core.filemode
- name: Test
run: npm test -- --filter=!dram
- name: Test "dram"
run: |
npm run test -- --filter=dram
env:
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: apps-${{ github.head_ref }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
- name: Check for changes
run: |
git config core.filemode false
git_status=$(git status --porcelain)
if [[ -n $git_status ]]; then
echo "You have uncommitted changes!"
git diff
git config --unset core.filemode
exit 1
fi
git config --unset core.filemode
- name: Build packages
run: npm run build -- --filter=!dram --filter=!somewhere
- name: Authenticate to npm registry
run: |
echo "//registry.npmjs.com/:_authToken=NPM_TOKEN" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Version packages
run: |
npx changeset version --snapshot unstable.$(git rev-parse --short HEAD) --snapshot-prerelease-template "{tag}"
git status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish packages
run: |
npx changeset publish --tag unstable --no-git-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true' # must be string, not boolean
- name: Deploy dram
run: |
npm run deploy --workspace dram -- --app dram-unstable --build-arg "VITE_APP_URL=$VITE_APP_URL" --build-arg "EDGEDB_INSTANCE=$EDGEDB_INSTANCE" --build-arg "EDGEDB_BRANCH=$EDGEDB_BRANCH" --build-secret "EDGEDB_SECRET_KEY=$EDGEDB_SECRET_KEY"
env:
VITE_APP_URL: https://dram-unstable.fly.dev
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: apps-${{ github.head_ref }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
FLY_ACCESS_TOKEN: ${{ secrets.FLY_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
- name: Deploy somewhere
run: |
npm run deploy --workspace somewhere -- --app somewhere-unstable --build-arg "VITE_APP_URL=$VITE_APP_URL"
env:
VITE_APP_URL: https://somewhere-unstable.fly.dev
FLY_ACCESS_TOKEN: ${{ secrets.FLY_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}