-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build and release wgc binaries | ||
# on: | ||
# release: | ||
# types: [published] | ||
on: | ||
pull_request: | ||
paths: | ||
- "cli/**/*" | ||
- "connect/**/*" | ||
- ".github/workflows/cli-ci.yaml" | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
wgc-releases-matrix: | ||
# if: startsWith(github.event.release.tag_name, 'wgc@') | ||
name: Build and release wgc binaries | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
strategy: | ||
matrix: | ||
target: [bun-linux-x64, bun-linux-arm64, bun-darwin-x64, bun-darwin-arm64] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: oven-sh/setup-bun@v2 | ||
|
||
- uses: ./.github/actions/node | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build | ||
run: pnpm run --filter ./cli --filter ./connect --filter ./shared --filter ./composition build | ||
|
||
- uses: winterjung/split@v2 | ||
id: split | ||
with: | ||
separator: "@" | ||
msg: "[email protected]" | ||
# msg: "${{ github.event.release.tag_name }}" | ||
|
||
- name: Set BUILD_TIME env | ||
run: echo BUILD_TIME=$(date -u +'%Y-%m-%dT%H:%M:%SZ') >> ${GITHUB_ENV} | ||
|
||
- name: "Build wgc binary" | ||
working-directory: cli | ||
run: bun build --compile --target ${{ matrix.target }} src/index.ts --outfile out/wgc-${{ steps.split.outputs._1 }}-${{ matrix.target }} | ||
|
||
- name: "Upload builds as artifacts" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wgc-${{ steps.split.outputs._1 }}-${{ matrix.target }} | ||
path: cli/out/wgc-${{ steps.split.outputs._1 }}-${{ matrix.target }} | ||
|
||
# - name: "Upload build to release" | ||
# working-directory: cli | ||
# env: | ||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# shell: bash | ||
# run: gh release upload ${{ github.event.release.tag_name }} wgc-${{ matrix.target }} --clobber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters