Add CI +semver-set:1.0.0+0 #2
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: Build and Tag | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
build-exe: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [2.7] | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Determine Version | |
id: staflversion | |
uses: StaflSystems/CustomGithubActions/DetermineVersion@main | |
- name: Display Version | |
run: | | |
echo "Version: ${{steps.staflversion.outputs.full}}" | |
- name: Build Executable | |
if: runner.os == 'windows' | |
run: | | |
pyinstaller --clean example.spec | |
- name: Build Executable | |
if: runner.os != 'windows' | |
run: | | |
pyinstaller --clean example.spec | |
cd dist | |
find . -wholename "*${{ steps.staflversion.outputs.full }}*" -exec sh -c 'mv "$1" "$1_${{ matrix.os }}"' _ {} \; | |
cd .. | |
- name: Create a GitHub release | |
if: github.ref == 'refs/heads/main' | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: dist/* | |
tag: ${{ steps.staflversion.outputs.full }} | |
allowUpdates: true |