Skip to content

Commit

Permalink
Create build-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DaltonSW committed Feb 10, 2024
1 parent be3b090 commit 819b935
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build and Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
name: Create Release
runs-on: [ubuntu-latest]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
build:
needs: release
strategy:
matrix:
include:
- os: windows-latest
BUILD_CMD: poetry run pyinstaller pyinstaller/PokeTerm.spec
OUT_FILENAME: PokeTerm.exe
UP_FILENAME: PokeTerm_Windows.exe
MIME_TYPE: application/vnd.microsoft.portable-executable
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pyinstaller
poetry install
- name: Run PyInstaller
run: ${{ matrix.BUILD_CMD }}
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./pyinstaller/dist/${{ matrix.OUT_FILENAME}}
asset_name: ${{ matrix.UP_FILENAME}}
asset_content_type: ${{ matrix.MIME_TYPE}}

0 comments on commit 819b935

Please sign in to comment.