Skip to content

Commit

Permalink
Auto release?
Browse files Browse the repository at this point in the history
  • Loading branch information
SavageCore committed Sep 13, 2023
1 parent 6569000 commit ed80b90
Showing 1 changed file with 16 additions and 40 deletions.
56 changes: 16 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,8 @@ on:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
createrelease:
name: Create Release
runs-on: [ubuntu-latest]
steps:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.createrelease.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v3
with:
name: release_url
path: release_url.txt

build:
name: Build packages
needs: createrelease
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -37,12 +18,12 @@ jobs:
pyinstaller -F -w -n torf-gui torfGUI/gui.py &&
cd dist/ &&
zip -r9 torf-gui torf-gui.app/
OUT_FILE_NAME: torf-gui.zip
OUT_FILE_NAME: torf-gui-macOS.zip
ASSET_MIME: application/zip
- os: windows-latest
TARGET: windows
CMD_BUILD: pyinstaller -F -w -n torf-gui torfGUI/gui.py
OUT_FILE_NAME: torf-gui.exe
OUT_FILE_NAME: torf-gui-win64.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
steps:
- uses: actions/checkout@v4
Expand All @@ -56,26 +37,21 @@ jobs:
pip install -r requirements.txt
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Load Release URL File from release job
uses: actions/download-artifact@v3
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

createrelease:
name: Create Release
needs: build
runs-on: [ubuntu-latest]
steps:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./dist/${{ matrix.OUT_FILE_NAME}}
asset_name: ${{ matrix.OUT_FILE_NAME}}
asset_content_type: ${{ matrix.ASSET_MIME}}
draft: true
generate_release_notes: true
prerelease: false
files: |
dist/torf-gui-macOS.zip
dist/torf-gui-win64.exe
permissions:
contents: write

0 comments on commit ed80b90

Please sign in to comment.