picodulce/.github/workflows/Build.yml
2024-12-31 14:22:50 -03:00

68 lines
1.9 KiB
YAML

name: Version Change Action
on:
push:
paths:
- version.json # Trigger on changes to version.json
jobs:
run-on-version-change:
runs-on: windows-latest # Use Windows 10 runner
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Specify the Python version you need
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyqt5 requests pywin32 pyinstaller pillow # Install specific dependencies
- name: Create actions-temp folder
run: |
mkdir actions-temp # Create the folder called actions-temp
- name: Download picoBuild.py script
run: |
curl -L -o actions-temp/picoBuild.py https://raw.githubusercontent.com/nixietab/picodulce-build-script/refs/heads/main/picoBuild.py
- name: Run picoBuild.py script
run: |
python actions-temp/picoBuild.py
create-release:
needs: run-on-version-change # Run only after the previous job
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Get version and name from version.json
id: version_info
run: |
$versionJson = Get-Content version.json | ConvertFrom-Json
echo "RELEASE_NAME=Release $($versionJson.version)" >> $env:GITHUB_ENV
echo "RELEASE_TAG=$($versionJson.version)" >> $env:GITHUB_ENV
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_NAME }}
body: "This release was created automatically by a GitHub Action."
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}