.github/workflows/Release.yml #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller aiohttp setuptools wheel build twine | |
- name: Get release tag | |
id: get_tag | |
run: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
shell: bash | |
- name: Build with PyInstaller | |
run: | | |
pyinstaller --onefile --icon=NONE --name ModpackChangelogger-${{ env.RELEASE_TAG }} modpack_changelogger.py | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Modpack-Changelogger-${{ env.RELEASE_TAG }} | |
path: dist/ModpackChangelogger* | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: dist/ModpackChangelogger-${{ env.RELEASE_TAG }}.exe | |
asset_name: ModpackChangelogger-${{ env.RELEASE_TAG }}.exe | |
asset_content_type: application/octet-stream | |
upload_and_publish: | |
name: Publish release to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel build | |
- name: Build package | |
run: | | |
python -m build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |