Skip to content

Commit 49f6e7b

Browse files
Merge pull request #585 from dolthub/eric/automate-release-process
Automate release process
2 parents fc4d57b + 67d77e3 commit 49f6e7b

File tree

13 files changed

+531
-8
lines changed

13 files changed

+531
-8
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Bump build version
2+
description: Bumps SemVer buildVersion in the input builder-config file
3+
inputs:
4+
build-config-file:
5+
description: File path to the builder config yaml file
6+
required: true
7+
commit:
8+
description: If true, will add and commit the new build version. Default false.
9+
required: false
10+
default: 'false'
11+
outputs:
12+
new-version:
13+
description: The bumped build version
14+
value: ${{ steps.bump-version.outputs.new_version }}
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Get current build version
19+
id: current-build-version
20+
run: |
21+
version="$(yq '.buildVersion' ${{ inputs.build-config-file }})"
22+
echo "Current buildVersion in ${{ inputs.build-config-file }} is $version"
23+
echo "version=$version" >> $GITHUB_OUTPUT
24+
shell: bash
25+
26+
- name: Bump version
27+
uses: "actions-ecosystem/action-bump-semver@v1"
28+
id: bump-version
29+
with:
30+
current_version: ${{ steps.current-build-version.outputs.version }}
31+
level: patch
32+
33+
- name: Update ${{ inputs.build-config-file }} buildVersion
34+
run: |
35+
yq -i '.buildVersion = "${{ steps.bump-version.outputs.new_version }}"' ${{ inputs.build-config-file }}
36+
echo "New buildVersion in ${{ inputs.build-config-file }} is ${{ steps.bump-version.outputs.new_version }}"
37+
shell: bash
38+
39+
- name: Add and commit new build version
40+
if: ${{ inputs.commit == 'true' }}
41+
uses: EndBug/add-and-commit@v9
42+
with:
43+
message: "Update ${{ inputs.build-config-file }} buildVersion to ${{ steps.bump-version.outputs.new_version }}"
44+
pull: origin
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Install dependencies
2+
description: Install common dependencies across all builds for dolt-workbench
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Enable Corepack
7+
shell: bash
8+
run: corepack enable
9+
10+
- name: Install graphql-server dependencies
11+
working-directory: graphql-server
12+
run: |
13+
yarn
14+
yarn build
15+
shell: bash
16+
17+
- name: Install web dependencies
18+
working-directory: web
19+
env:
20+
GITHUB_TOKEN: ${{ github.token }}
21+
run: |
22+
yarn
23+
yarn download:dolt
24+
shell: bash
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Build dolt-workbench for Mac
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release-version:
6+
description: GitHub Release Version Number
7+
required: true
8+
type: string
9+
10+
workflow_call:
11+
inputs:
12+
release-version:
13+
description: Github Release Version Number
14+
required: true
15+
type: string
16+
17+
jobs:
18+
build-dmg:
19+
name: Build Mac release version
20+
runs-on: macos-14
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Bump build version
26+
uses: ./.github/actions/bump-build-version
27+
with:
28+
build-config-file: web/build/builder-dmg-config.yaml
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: "latest"
33+
34+
- name: Install dependencies
35+
uses: ./.github/actions/install-dependencies
36+
37+
- name: Download provisioning profiles
38+
id: download-provisioning-profiles
39+
uses: apple-actions/download-provisioning-profiles@v4
40+
with:
41+
bundle-id: com.dolthub.dolt-workbench
42+
profile-type: MAC_APP_DEVELOPMENT
43+
issuer-id: ${{ vars.APPSTORE_ISSUER_ID }}
44+
api-key-id: ${{ vars.APPSTORE_API_KEY_ID }}
45+
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
46+
47+
- name: Move provision profile to build directory
48+
run: |
49+
JSON='${{ steps.download-provisioning-profiles.outputs.profiles }}'
50+
UDID=$(echo $JSON | jq -r '.[0].udid')
51+
mv "$HOME/Library/MobileDevice/Provisioning Profiles/$UDID.provisionprofile" "${{ github.workspace }}/web/build/mac/AppleDevelopment.provisionprofile"
52+
53+
- name: Import codesign certs
54+
uses: apple-actions/import-codesign-certs@v3
55+
with:
56+
p12-file-base64: ${{ secrets.DEV_ID_CERT_BASE64 }}
57+
p12-password: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }}
58+
59+
- name: Cache Next.js build
60+
uses: actions/cache@v4
61+
with:
62+
path: |
63+
web/renderer/.next/cache
64+
web/.next/cache
65+
key: nextjs-${{ runner.os }}-${{ hashFiles('web/renderer/next.config.js', 'web/package.json', 'web/yarn.lock') }}
66+
restore-keys: |
67+
nextjs-${{ runner.os }}-
68+
69+
- name: Build dmg package
70+
working-directory: web
71+
env:
72+
CSC_LINK: ${{ secrets.DEV_ID_CERT_BASE64 }}
73+
CSC_KEY_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }}
74+
run: |
75+
yarn build:dmg
76+
77+
- name: Create .env file for signing
78+
working-directory: web/build/mac
79+
run: |
80+
cat > .env <<'EOF'
81+
SIGNING_CERTIFICATE="Developer ID Application: DoltHub Inc (${{ vars.TEAM_ID }})"
82+
TEAM_ID="${{ vars.TEAM_ID }}"
83+
APPLE_ID="${{ vars.APPLE_ID }}"
84+
APPLE_ID_PASSWORD="${{ secrets.APPLE_ID_PASSWORD }}"
85+
EOF
86+
87+
- name: Sign and notarize
88+
working-directory: web
89+
run: |
90+
yarn sign-dmg
91+
92+
- name: Upload package to Release ${{ inputs.release-version }}
93+
uses: softprops/action-gh-release@v2
94+
with:
95+
tag_name: v${{ inputs.release-version }}
96+
files: ${{ github.workspace }}/web/dist/DoltWorkbench-mac-arm64.dmg
97+
98+
commit-build-version:
99+
name: Commit new build version
100+
needs: build-dmg
101+
runs-on: ubuntu-22.04
102+
concurrency:
103+
group: commit-build-version
104+
cancel-in-progress: false
105+
steps:
106+
- uses: actions/checkout@v3
107+
108+
- uses: ./.github/actions/bump-build-version
109+
with:
110+
build-config-file: web/build/builder-dmg-config.yaml
111+
commit: true
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build dolt-workbench for Linux
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release-version:
6+
description: GitHub Release Version Number
7+
required: true
8+
type: string
9+
10+
workflow_call:
11+
inputs:
12+
release-version:
13+
description: Github Release Version Number
14+
required: true
15+
type: string
16+
17+
jobs:
18+
build-linux:
19+
name: Build Linux release version
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Bump linux build version
26+
uses: ./.github/actions/bump-build-version
27+
with:
28+
build-config-file: web/build/builder-linux-config.yaml
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: "latest"
33+
34+
- name: Install dependencies
35+
uses: ./.github/actions/install-dependencies
36+
37+
- name: Cache Next.js build
38+
uses: actions/cache@v4
39+
with:
40+
path: |
41+
web/renderer/.next/cache
42+
web/.next/cache
43+
key: nextjs-${{ runner.os }}-${{ hashFiles('web/renderer/next.config.js', 'web/package.json', 'web/yarn.lock') }}
44+
restore-keys: |
45+
nextjs-${{ runner.os }}-
46+
47+
- name: Build Linux package
48+
working-directory: web
49+
run: |
50+
yarn build:linux
51+
ls dist
52+
53+
- name: Upload package to Release ${{ inputs.release-version }}
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
tag_name: v${{ inputs.release-version }}
57+
files: |
58+
${{ github.workspace }}/web/dist/Dolt-Workbench-linux-x86_64.AppImage
59+
${{ github.workspace }}/web/dist/Dolt-Workbench-linux-arm64.AppImage
60+
61+
commit-build-version:
62+
name: Commit new build version
63+
needs: build-linux
64+
runs-on: ubuntu-22.04
65+
concurrency:
66+
group: commit-build-version
67+
cancel-in-progress: false
68+
steps:
69+
- uses: actions/checkout@v3
70+
71+
- uses: ./.github/actions/bump-build-version
72+
with:
73+
build-config-file: web/build/builder-linux-config.yaml
74+
commit: true
75+
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build dolt-workbench for Mac App Store
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release-version:
6+
description: GitHub Release Version Number
7+
required: true
8+
type: string
9+
10+
workflow_call:
11+
inputs:
12+
release-version:
13+
description: Github Release Version Number
14+
required: true
15+
type: string
16+
17+
jobs:
18+
build-mas:
19+
name: Build Mac App Store release version
20+
runs-on: macos-14
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Bump MAS build version
26+
id: bump-mas-version
27+
uses: ./.github/actions/bump-build-version
28+
with:
29+
build-config-file: web/build/builder-mas-config.yaml
30+
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: "latest"
34+
35+
- name: Install dependencies
36+
uses: ./.github/actions/install-dependencies
37+
38+
- name: Download provisioning profiles
39+
id: download-provisioning-profiles
40+
uses: apple-actions/download-provisioning-profiles@v4
41+
with:
42+
bundle-id: com.dolthub.dolt-workbench
43+
profile-type: MAC_APP_STORE
44+
issuer-id: ${{ vars.APPSTORE_ISSUER_ID }}
45+
api-key-id: ${{ vars.APPSTORE_API_KEY_ID }}
46+
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
47+
48+
- name: Move provision profile to build directory
49+
run: |
50+
JSON='${{ steps.download-provisioning-profiles.outputs.profiles }}'
51+
UDID=$(echo $JSON | jq -r '.[0].udid')
52+
mv "$HOME/Library/MobileDevice/Provisioning Profiles/$UDID.provisionprofile" "${{ github.workspace }}/web/build/mac/MacAppStore.provisionprofile"
53+
54+
- name: Cache Next.js build
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
web/renderer/.next/cache
59+
web/.next/cache
60+
key: nextjs-${{ runner.os }}-${{ hashFiles('web/renderer/next.config.js', 'web/package.json', 'web/yarn.lock') }}
61+
restore-keys: |
62+
nextjs-${{ runner.os }}-
63+
64+
- name: Build MAS package
65+
working-directory: web
66+
env:
67+
CSC_LINK: ${{ secrets.MAS_APP_CERT_BASE64 }}
68+
CSC_KEY_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }}
69+
CSC_INSTALLER_LINK: ${{ secrets.MAS_INSTALLER_CERT_BASE64 }}
70+
CSC_INSTALLER_KEY_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }}
71+
run: |
72+
yarn build:mas
73+
echo "DIST:"
74+
ls dist
75+
echo "mas-universal":
76+
ls dist/mas-universal
77+
78+
- name: Upload app store artifact
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: mac-${{ inputs.release-version }}
82+
path: ${{ github.workspace }}/web/dist/mas-universal/DoltWorkbench-mac-universal-${{ steps.bump-mas-version.outputs.new-version }}.pkg
83+
retention-days: 90
84+
overwrite: true
85+
86+
commit-build-version:
87+
name: Commit new build version
88+
needs: build-mas
89+
runs-on: ubuntu-22.04
90+
concurrency:
91+
group: commit-build-version
92+
cancel-in-progress: false
93+
steps:
94+
- uses: actions/checkout@v3
95+
96+
- uses: ./.github/actions/bump-build-version
97+
with:
98+
build-config-file: web/build/builder-mas-config.yaml
99+
commit: true

0 commit comments

Comments
 (0)