Release #58
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
name: Release | |
on: | |
workflow_dispatch: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
cache: 'pipenv' | |
- name: Install pipenv | |
run: pip install pipenv | |
- name: Install dependencies with pipenv | |
run: pipenv --python 3.8 && pipenv install | |
- name: Install PyInstaller | |
run: pipenv install pyinstaller | |
- name: Build the application | |
run: pipenv run pyinstaller tkinter_ui.spec | |
- name: List dist directory contents | |
run: dir dist | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: update-tool | |
path: dist | |
- name: Get version from version.json | |
id: get_info | |
run: | | |
$version = (Get-Content version.json | ConvertFrom-Json).version | |
echo "version=$version" >> $env:GITHUB_ENV | |
shell: pwsh | |
- name: Install jq | |
run: choco install jq | |
- name: Get changelog | |
id: get_changelog | |
run: | | |
$version = "${{ env.version }}" | |
$changelog = (Get-Content CHANGELOG.md) -join "`n" | |
$changelog = $changelog -replace "(?s).*?## v$version", "" | |
$changelog = $changelog -replace "(?s)## v.*", "" | |
$changelog = $changelog -replace "(?s).*?###", "###" | |
$changelog = $changelog.TrimEnd("`n") | |
$changelog | jq -Rs '.' | ForEach-Object { echo "changelog=$_"; echo "changelog=$_" >> $env:GITHUB_ENV } | |
shell: pwsh | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.version }} | |
release_name: v${{ env.version }} | |
body: ${{ fromJSON(env.changelog) }} | |
draft: false | |
prerelease: false | |
- name: 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/update-tool.exe | |
asset_name: update-tool.exe | |
asset_content_type: application/octet-stream |