diff --git a/.github/workflows/python-job.yml b/.github/workflows/python-job.yml index d11843c..8014f9b 100644 --- a/.github/workflows/python-job.yml +++ b/.github/workflows/python-job.yml @@ -6,6 +6,9 @@ on: python-version: type: string default: "3.9" + runner: + type: string + default: ubuntu-latest run: required: true type: string @@ -20,7 +23,10 @@ on: jobs: run: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runner }} + defaults: + run: + shell: bash steps: - name: Checkout source code uses: actions/checkout@v4 @@ -41,6 +47,8 @@ jobs: - name: Run Command run: | ${{ inputs.run }} + env: + GH_TOKEN: ${{ github.token }} - name: Upload artifacts uses: actions/upload-artifact@v4 @@ -49,4 +57,3 @@ jobs: name: ${{ inputs.artifact }} path: ${{ inputs.artifact_path }} if-no-files-found: ignore - diff --git a/.github/workflows/release_exe.yml b/.github/workflows/release_exe.yml new file mode 100644 index 0000000..4964285 --- /dev/null +++ b/.github/workflows/release_exe.yml @@ -0,0 +1,22 @@ +name: Release Windows Build + +on: + push: + branches: + - main +jobs: + windows-release: + uses: ./.github/workflows/python-job.yml + secrets: inherit + with: + runner: windows-latest + python-version: "3.9" + run: | + pyinstaller --onefile --exclude demo dk-installer.py + export RELEASE_TAG=latest + gh release delete "${RELEASE_TAG}" -y || true + git push origin --delete "${RELEASE_TAG}" || true + git tag "${RELEASE_TAG}" + git push origin "${RELEASE_TAG}" + gh release create "${RELEASE_TAG}" ./dist/dk-installer.exe \ + --title "Latest Release"