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 - name: Read version and name from version.json id: version run: | $VERSION = (jq -r '.version' version.json) $NAME = (jq -r '.name' version.json) echo "VERSION=$VERSION" >> $GITHUB_ENV # Store version in the environment variable echo "NAME=$NAME" >> $GITHUB_ENV # Store name in the environment variable - name: Check if tag exists run: | git tag # List the tags in the repository to check if the tag exists - name: Tag release run: | # Set Git user for the GitHub Actions runner git config user.name "github-actions" git config user.email "github-actions@github.com" # Set VERSION_NAME using environment variables echo "VERSION_NAME=${{ env.VERSION }} ${{ env.NAME }}" >> $GITHUB_ENV # Store the full version name # Create the tag and push it to GitHub git tag -a "v${{ env.VERSION }}" -m "Release ${{ env.VERSION }} ${{ env.NAME }}" # Tag the release git push origin --tags # Push all tags to GitHub - name: Create Release uses: softprops/action-gh-release@v1 with: files: actions-temp/build/2hsu.exe # Specify the path to the file to upload