From deefdf3994deedcc2afc49749ba25fc9991fc7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E9=94=8B?= <18508478357@163.com> Date: Mon, 2 Feb 2026 11:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(workflows):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0github=20workflows=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d058156 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,71 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + build-and-release: + name: Build ${{ matrix.platform }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: macos-latest + platform: darwin/amd64 + artifact_name: GoNavi-mac-amd64 + - os: macos-latest + platform: darwin/arm64 + artifact_name: GoNavi-mac-arm64 + - os: windows-latest + platform: windows/amd64 + artifact_name: GoNavi-windows-amd64 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + check-latest: true + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + + - name: Build + shell: bash + run: | + wails build -platform ${{ matrix.platform }} -clean -o ${{ matrix.artifact_name }} + + - name: Package (macOS) + if: runner.os == 'macOS' + run: | + cd build/bin + zip -r ../../${{ matrix.artifact_name }}.zip ${{ matrix.artifact_name }}.app + + - name: Package (Windows) + if: runner.os == 'Windows' + shell: bash + run: | + mv build/bin/${{ matrix.artifact_name }}.exe . + + - name: Upload Release Asset + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ${{ matrix.artifact_name }}.zip + ${{ matrix.artifact_name }}.exe + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file