diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13ca1a9..55b0655 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,38 +5,10 @@ on: tags: - "*" workflow_dispatch: - inputs: - skip-go: - required: false - skip-cpp: - required: false - skip-python: - required: false jobs: - build-go: + build: runs-on: windows-latest - if: github.event.inputs.skip-go != 'y' - steps: - - uses: actions/checkout@v4 - with: - repository: anosora233/mahjong-helper - - - uses: actions/setup-go@v5 - with: - go-version: ^1.22 - - - run: | - go build -v - - - uses: actions/upload-artifact@v4 - with: - name: endless - path: mahjong-helper.exe - - build-cpp: - runs-on: windows-latest - if: github.event.inputs.skip-cpp != 'y' steps: - uses: actions/checkout@v4 with: @@ -47,13 +19,18 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: proxinject + name: proxinject-${{ github.sha }} path: release - build-python: + pack: runs-on: windows-latest - if: github.event.inputs.skip-python != 'y' + needs: build steps: + - uses: actions/download-artifact@v4 + with: + name: proxinject-${{ github.sha }} + path: proxinject + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -64,45 +41,19 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements.txt python -m pip install pyinstaller + pyinstaller --clean mhmp.spec #### - pyinstaller --clean mhmp.spec - - - uses: actions/upload-artifact@v4 - with: - name: mhmp-pre - path: dist/mhmp - - pack: - runs-on: ubuntu-latest - needs: - - build-go - - build-cpp - - build-python - steps: - - uses: actions/download-artifact@v4 - with: - path: artifacts - - - run: | - mv artifacts/mhmp-pre mhmp - mkdir -p mhmp/common - mv artifacts/endless mhmp/common/ - mv artifacts/proxinject mhmp/common/ + mv dist/mhmp ./ + mv proxinject mhmp/ + 7z a mhmp-${{ github.ref_name }}-win64.7z ./mhmp - uses: actions/upload-artifact@v4 with: - name: develop + name: mhmp-${{ github.sha }} path: mhmp - - if: github.ref_type == 'tag' - run: | - 7z a common-win64.7z ./mhmp/common - 7z a mhmp-${{ github.ref_name }}-win64.7z ./mhmp - - if: github.ref_type == 'tag' uses: softprops/action-gh-release@v2 with: token: ${{ secrets.PAT }} - files: | - common-win64.7z - mhmp-${{ github.ref_name }}-win64.7z + files: mhmp-${{ github.ref_name }}-win64.7z