From f17ce363fdaebd7eee720f4b9dea4ff056d62b6d Mon Sep 17 00:00:00 2001 From: tledoux Date: Wed, 7 Aug 2024 17:34:35 +0200 Subject: [PATCH] Add build app workflow --- .github/workflows/build-win-app.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build-win-app.yml diff --git a/.github/workflows/build-win-app.yml b/.github/workflows/build-win-app.yml new file mode 100644 index 0000000..9aa06d8 --- /dev/null +++ b/.github/workflows/build-win-app.yml @@ -0,0 +1,57 @@ +name: Build Windows application workflow + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build-windows: + runs-on: windows-lastest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + architecture: "x64" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Run Pyinstaller + run: | + pyinstaller donatemail.spec + - uses: actions/upload-artifacts@v3 + with: + name: DONATEMAIL + path: dist/DONATEMAIL.EXE + + - name: create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + #tag_name: ${{ github.event.head_commit.message }} + #release_name: ${{ github.event.head_commit.message }} + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + overwrite: true + generateReleaseNotes: true + draft: false + prerelease: false + + - name: upload release asset + id: upload_release_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: dist/DONATEMAIL.exe + asset_name: DONATEMAIL-windows-amd64.exe + asset_content_type: application/zip \ No newline at end of file