Skip to content

Commit

Permalink
another workflow attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
shadoxxhd committed Oct 14, 2024
1 parent 8af6a25 commit 114905a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/main.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Package Application with Pyinstaller

on: [ push ]
on: [ push, pull_request ]

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Create Executable
uses: sayyid5416/pyinstaller@v1
Expand All @@ -17,9 +17,4 @@ jobs:
spec: 'downloader.spec'
requirements: 'requirements.txt'
upload_exe_with_name: 'downloader.exe'
options: --onefile, --name "Steam Workshop Downloader", --windowed,

- uses: actions/upload-artifact@v4
with:
name: downloader.exe
path: src/dist/windows
options: --onefile, --name "Steam Workshop Downloader", --windowed,
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release tagged build

on:
push:
tags: [ '*' ]

permissions:
contents: write

jobs:
build:
runs-on: windows-latest
env:
VERSION: ${{ github.ref_name }}
RELEASE_VERSION: ${{ github.ref_name }}
SNAPSHOT: ${{ endsWith(github.ref_name, '-snapshot') || contains(github.event.head_commit.message, '[snapshot]') }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Delete old release if it already exists
run: gh release delete --yes "${RELEASE_VERSION}"
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release under current tag
run: |
PRERELEASE=""
if [[ "$SNAPSHOT" == "true" ]]; then
PRERELEASE="--prerelease"
fi
export "CHANGELOG_FILE=$(mktemp --suffix=.md)"
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV
gh api --method POST -H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
-f tag_name="${RELEASE_VERSION}" \
--jq ".body" > "${CHANGELOG_FILE}"
cat "${CHANGELOG_FILE}"
gh release create "${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" $PRERELEASE ./dist/*
shell: bash
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 114905a

Please sign in to comment.