Skip to content

update for 3.26

update for 3.26 #11

Workflow file for this run

name: Build and Release
on:
push:
branches:
- main
paths:
- '__version__.py'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
outputs:
tag_name: ${{ steps.tag.outputs.tag }}
release_body: ${{ steps.notes.outputs.body }}
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Get version
id: get_version
run: |
$version = python -c "from __version__ import __version__; print(__version__)"
echo "version=$version" >> $env:GITHUB_OUTPUT
echo "Version: $version"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir -r requirements.txt
pip install pyinstaller
- name: Build executable
run: pyinstaller --onefile --windowed --name PathOfExileFlipper main.py
- name: Archive executable
uses: actions/upload-artifact@v4
with:
name: executable
path: dist/PathOfExileFlipper.exe
- name: Generate release notes
id: notes
run: |
echo "body=$(git log -1 --pretty=format:'%h - %s')" >> $GITHUB_OUTPUT
- name: Create and push tag
id: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$TAG = "v${{ steps.get_version.outputs.version }}"
echo "tag=$TAG" >> $env:GITHUB_OUTPUT
git tag $TAG
git push origin $TAG
release:
needs: build
runs-on: windows-latest
steps:
- name: Download executable
uses: actions/download-artifact@v4
with:
name: executable
path: dist
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.build.outputs.tag_name }}
release_name: "PathOfExileFlipper v${{ needs.build.outputs.version }}"
body: ${{ needs.build.outputs.release_body }}
- 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 }}
asset_path: dist/PathOfExileFlipper.exe
asset_name: PathOfExileFlipper.exe
asset_content_type: application/octet-stream