diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2ea2a97 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: ๐Ÿงช CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + test-and-check: + name: ๐Ÿงช Test & Type-Check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Type-check + run: bun run check + + - name: Test + run: bun test diff --git a/.github/workflows/binaries.yml b/.github/workflows/release.yml similarity index 90% rename from .github/workflows/binaries.yml rename to .github/workflows/release.yml index 796a17f..41ae2f1 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,17 @@ -name: Binaries +name: ๐Ÿš€ Release on: push: - branches: - - master tags: - "v*" - pull_request: - branches: - - master workflow_dispatch: permissions: contents: write jobs: - build-and-release: - name: Build & Release Binaries + build-and-publish: + name: ๐Ÿš€ Build & Publish Multi-Platform Binaries runs-on: ubuntu-latest steps: - name: Checkout @@ -37,13 +32,11 @@ jobs: run: bun test - name: Compile multi-target binaries - if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' run: | mkdir -p dist/bin node scripts/build-binary.mjs --all - name: Package release archives - if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' run: | sudo apt-get update && sudo apt-get install -y zip cd dist/bin @@ -54,7 +47,6 @@ jobs: zip -q seal-home-windows-x64.zip seal-home-windows-x64.exe - name: Publish GitHub Release - if: startsWith(github.ref, 'refs/tags/v') env: GH_TOKEN: ${{ github.token }} run: | @@ -67,7 +59,6 @@ jobs: gh release upload "${GITHUB_REF_NAME}" dist/bin/seal-home-* --repo "${GITHUB_REPOSITORY}" --clobber - name: Publish Gitea Release - if: startsWith(github.ref, 'refs/tags/v') env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_HOST: "https://git.ying-qing.cn" @@ -109,4 +100,3 @@ jobs: echo " Upload response: $(echo "$RESP" | tail -n 1)" done echo "โœ“ Successfully published release assets to Gitea!" -