Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: refine the release action (#1836)

rebelice99704473fcc7
diff --git a/.github/workflows/build-artifacts-and-draft-release.yml b/.github/workflows/build-artifacts-and-draft-release.yml
index d077ba78b1..6378e7cf6c 100644
--- a/.github/workflows/build-artifacts-and-draft-release.yml
+++ b/.github/workflows/build-artifacts-and-draft-release.yml
@@ -6,7 +6,7 @@ on:
- "*.*.*"
jobs:
- release-linux-binary:
+ build-linux-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -29,13 +29,18 @@ jobs:
cache: true
- name: Install cross-compiler for linux/arm64
run: sudo apt-get -y install gcc-aarch64-linux-gnu
- - name: Release
+ - name: Build
uses: goreleaser/goreleaser-action@v2
with:
- args: release --config .goreleaser-for-linux.yaml
+ args: release --skip-publish --config .goreleaser-for-linux.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- release-darwin-binary:
+ - name: Upload
+ uses: actions/upload-artifact@v3
+ with:
+ name: bytebase-linux
+ path: dist/bytebase*
+ build-darwin-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
@@ -56,9 +61,63 @@ jobs:
go-version: 1.16
check-latest: true
cache: true
+ - name: Build
+ uses: goreleaser/goreleaser-action@v2
+ with:
+ args: release --skip-publish --config .goreleaser-for-darwin.yaml
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Upload
+ uses: actions/upload-artifact@v3
+ with:
+ name: bytebase-darwin
+ path: dist/bytebase*
+ draft-release:
+ needs: [build-linux-binary, build-darwin-binary]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: pnpm/[email protected]
+ with:
+ version: 6.10.0
+ - uses: actions/setup-node@v3
+ with:
+ node-version: "14"
+ cache: pnpm
+ cache-dependency-path: "frontend/pnpm-lock.yaml"
+ - run: pnpm install --frozen-lockfile
+ working-directory: frontend
+ - run: pnpm release
+ working-directory: frontend
+ - uses: actions/setup-go@v3
+ with:
+ go-version: 1.16
+ check-latest: true
+ cache: true
+ - name: Make directories
+ run: |
+ mkdir -p ./bytebase-build/linux
+ mkdir -p ./bytebase-build/darwin
+ - name: Download linux binaries
+ uses: actions/download-artifact@v3
+ with:
+ name: bytebase-linux
+ path: ./bytebase-build/linux
+ - name: Download darwin binaries
+ uses: actions/download-artifact@v3
+ with:
+ name: bytebase-darwin
+ path: ./bytebase-build/darwin
+ - name: Merge checksum file
+ run: |
+ cd ./bytebase-build
+ cat ./darwin/bytebase*checksums.txt >> checksums.txt
+ cat ./linux/bytebase*checksums.txt >> checksums.txt
+ rm ./darwin/bytebase*checksums.txt
+ rm ./linux/bytebase*checksums.txt
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
- args: release --config .goreleaser-for-darwin.yaml
+ args: release --config .goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index dd4ce6069d..735631f4d8 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -29,7 +29,7 @@ jobs:
version: v1.45.2
args: -v
- # Copied from draft-release.yml, should be consistent if updating draft-release.yml.
+ # Copied from build-artifacts-and-draft-release.yml, should be consistent if updating build-artifacts-and-draft-release.yml.
release-dry-run-linux:
runs-on: ubuntu-latest
steps:
diff --git a/.goreleaser-for-darwin.yaml b/.goreleaser-for-darwin.yaml
index b4475da78c..0b173fcdef 100644
--- a/.goreleaser-for-darwin.yaml
+++ b/.goreleaser-for-darwin.yaml
@@ -56,29 +56,5 @@ archives:
darwin: Darwin
linux: Linux
amd64: x86_64
-checksum:
- name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
-changelog:
- sort: asc
- filters:
- exclude:
- - "^docs:"
- - "^test:"
-release:
- draft: true
- mode: append
- name_template: "Release {{.Tag}}"
- header: |
- # What's Changed
-
- ## 🚀 Features
-
- ## 🎄 Enhancements
-
- ## 🎠 Community
-
- ## New Contributors
-
- ## Code Diff
diff --git a/.goreleaser-for-linux.yaml b/.goreleaser-for-linux.yaml
index 74473b8e89..1261f6bbf2 100644
--- a/.goreleaser-for-linux.yaml
+++ b/.goreleaser-for-linux.yaml
@@ -74,29 +74,5 @@ archives:
darwin: Darwin
linux: Linux
amd64: x86_64
-checksum:
- name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
-changelog:
- sort: asc
- filters:
- exclude:
- - "^docs:"
- - "^test:"
-release:
- draft: true
- mode: append
- name_template: "Release {{.Tag}}"
- header: |
- # What's Changed
-
- ## 🚀 Features
-
- ## 🎄 Enhancements
-
- ## 🎠 Community
-
- ## New Contributors
-
- ## Code Diff
diff --git a/.goreleaser-release.yaml b/.goreleaser-release.yaml
new file mode 100644
index 0000000000..a568052b83
--- /dev/null
+++ b/.goreleaser-release.yaml
@@ -0,0 +1,27 @@
+builds:
+ - skip: true
+changelog:
+ sort: asc
+ filters:
+ exclude:
+ - "^docs:"
+ - "^test:"
+release:
+ draft: true
+ mode: append
+ extra_files:
+ - glob: ./bytebase-build/**/*
+ - glob: ./bytebase-build/checksums.txt
+ name_template: "Release {{.Tag}}"
+ header: |
+ # What's Changed
+
+ ## 🚀 Features
+
+ ## 🎄 Enhancements
+
+ ## 🎠 Community
+
+ ## New Contributors
+
+ ## Code Diff