diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 0dbd0643c..ec071458e 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -32,6 +32,10 @@ version-resolver: - 'patch' default: patch template: | - ## Changes + # Changes + + $CHANGES + + # 更新日志 $CHANGES \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a10e7a9c6..2b290bba1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,11 @@ name: build on: workflow_dispatch: + inputs: + platform: + description: 'Build platform' + required: true + default: 'all' env: GO_VERSION: "1.19" @@ -24,6 +29,7 @@ jobs: myToken: ${{ github.token }} build-windows: + if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'windows' }} runs-on: windows-latest needs: [ get-release ] steps: @@ -124,6 +130,7 @@ jobs: asset_path: ui/flutter/build/windows/Output/* overwrite: true build-macos-arm64-lib: + if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }} runs-on: ubuntu-latest needs: [ get-release ] steps: @@ -134,13 +141,14 @@ jobs: - name: Build run: | go install src.techknowlogick.com/xgo@latest - xgo -go go-1.19.x --targets=darwin/arm64 -tags="nosqlite" -ldflags="-w -s" -buildmode=c-shared -pkg=bind/desktop -out=libgopeed . + xgo -go go-$GO_VERSION.x --targets=darwin/arm64 -tags="nosqlite" -ldflags="-w -s" -buildmode=c-shared -pkg=bind/desktop -out=libgopeed . mv libgopeed-*.dylib libgopeed.dylib - uses: actions/upload-artifact@v3 with: name: macos-arm64-lib path: libgopeed.dylib build-macos: + if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }} runs-on: macos-latest needs: [ get-release, build-macos-arm64-lib ] steps: @@ -197,6 +205,7 @@ jobs: asset_path: ui/flutter/build/macos/Build/Products/Release/dist/* overwrite: true build-linux: + if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' }} runs-on: ubuntu-latest needs: [ get-release ] steps: @@ -210,6 +219,10 @@ jobs: - run: | sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev libayatana-appindicator3-dev + - name: Setup LXD + uses: canonical/setup-lxd@v0.1.1 + with: + channel: latest/stable - name: Build env: VERSION: ${{ needs.get-release.outputs.tag_name }} @@ -217,13 +230,20 @@ jobs: go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop cd ui/flutter flutter build linux + mkdir -p build/dist + + # Build portable + tar -czaf build/dist/Gopeed-$VERSION-linux-amd64-portable.tar.gz build/linux/x64/release/bundle + + + # Build deb package mkdir -p debian/gui cp assets/icon/icon_1024.png debian/gui/gopeed.png cat>debian/debian.yaml<AppImageBuilder.yml<snap/snapcraft.yaml<snap/gui/gopeed.desktop<