Skip to content

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

chore: optimize release job definitions (#1933)

Yilong Li37bdfc5121fd
diff --git a/.github/workflows/build-artifacts-and-draft-release.yml b/.github/workflows/build-artifacts-and-draft-release.yml
index f1d2e94834..cfe8f04023 100644
--- a/.github/workflows/build-artifacts-and-draft-release.yml
+++ b/.github/workflows/build-artifacts-and-draft-release.yml
@@ -6,8 +6,13 @@ on:
- "*.*.*"
jobs:
- build-linux-binary:
- runs-on: ubuntu-latest
+ build-binary:
+ strategy:
+ matrix:
+ os:
+ - "ubuntu"
+ - "macos"
+ runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
@@ -30,39 +35,7 @@ jobs:
- name: Build
uses: goreleaser/goreleaser-action@v2
with:
- args: release --skip-publish --config .goreleaser-for-linux.yaml
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - 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
- - 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.18
- check-latest: true
- cache: true
- - name: Build
- uses: goreleaser/goreleaser-action@v2
- with:
- args: release --skip-publish --config .goreleaser-for-darwin.yaml
+ args: release --skip-publish --config .goreleaser-for-${{ matrix.os }}.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
@@ -70,8 +43,10 @@ jobs:
with:
name: bytebase-darwin
path: dist/bytebase*
+
draft-release:
- needs: [build-linux-binary, build-darwin-binary]
+ needs:
+ - build-binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 198b7676ec..be633570fb 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -31,36 +31,13 @@ jobs:
args: -v
# 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:
- - 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.18
- check-latest: true
- cache: true
- - name: Release dry-run
- uses: goreleaser/goreleaser-action@v2
- with:
- args: release --skip-publish --config .goreleaser-for-linux.yaml
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- release-dry-run-darwin:
- runs-on: macos-latest
+ release-dry-run:
+ strategy:
+ matrix:
+ os:
+ - "ubuntu"
+ - "macos"
+ runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
@@ -80,10 +57,10 @@ jobs:
go-version: 1.18
check-latest: true
cache: true
- - name: Release dry-run
+ - name: Build
uses: goreleaser/goreleaser-action@v2
with:
- args: release --skip-publish --config .goreleaser-for-darwin.yaml
+ args: release --skip-publish --config .goreleaser-for-${{ matrix.os }}.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.goreleaser-for-darwin.yaml b/.goreleaser-for-macos.yaml
similarity index 100%
rename from .goreleaser-for-darwin.yaml
rename to .goreleaser-for-macos.yaml
diff --git a/.goreleaser-for-linux.yaml b/.goreleaser-for-ubuntu.yaml
similarity index 100%
rename from .goreleaser-for-linux.yaml
rename to .goreleaser-for-ubuntu.yaml