Buildtest #9
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 Release | |
on: | |
push: | |
branches: [ "main", "dev" ] | |
pull_request: | |
branches: [ "main", "dev" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: pip install -r ./package/requirements.txt | |
- name: Install Inno Setup | |
run: | | |
curl -L -o innosetup.exe "https://jrsoftware.org/download.php/is.exe" | |
cmd /c "innosetup.exe /VERYSILENT /NORESTART" | |
- name: Extract Version | |
id: extract_version | |
run: | | |
python -c "from tik_manager4 import _version; print(_version.__version__)" > version.txt | |
FOR /F "tokens=*" %%i IN (version.txt) DO echo VERSION=%%i >> $GITHUB_ENV | |
shell: cmd | |
- name: Build and package | |
run: | | |
cd package | |
./make release | |
- name: Debug Version Value | |
run: echo "VERSION=${{ env.VERSION }}" | |
- name: List Build Directory | |
run: dir package\build | |
shell: cmd | |
- name: Verify the Built File | |
run: | | |
if not exist "package\build\TikManager4_v${{ env.VERSION }}.exe" exit 1 | |
shell: cmd | |
- name: Upload Release Assets | |
uses: actions/upload-artifact@v3 | |
with: | |
name: TikManager4 | |
path: package/build/TikManager4_v${{ env.VERSION }}.exe | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: package/build/TikManager4_v${{ env.VERSION }}.exe | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
body: | | |
Automated release for version ${{ github.ref_name }}. |