Skip to content

Merge pull request #169 from masqu3rad3/dev #36

Merge pull request #169 from masqu3rad3/dev

Merge pull request #169 from masqu3rad3/dev #36

Workflow file for this run

name: Build and Release
on:
push:
branches:
- "main"
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: Extract Version from _version.py
id: extract_version
run: |
$VERSION = python -c "from tik_manager4 import _version; print(_version.__version__)"
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: pwsh
- name: Debug Version
run: echo "Extracted version is ${{ env.VERSION }}"
- name: Extract Release Notes
id: extract_notes
shell: bash
run: |
NOTES=""
CAPTURE=0
while IFS= read -r line; do
if [[ $line =~ ^##\ v${{ env.VERSION }} ]]; then
CAPTURE=1
continue
fi
if [[ $CAPTURE -eq 1 && $line =~ ^## ]]; then
break
fi
if [[ $CAPTURE -eq 1 ]]; then
NOTES+="$line\n"
fi
done < RELEASE_NOTES.md
echo "NOTES=${NOTES}" >> $GITHUB_ENV
echo "::set-output name=notes::${NOTES}"
- name: Debug Release Notes
run: echo -e "${{ env.NOTES }}"
- name: Check if Release Tag Exists
id: check_tag
run: |
git fetch --tags
if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
echo "Error: Tag v${{ env.VERSION }} already exists."
exit 1
fi
shell: bash
- name: Install Inno Setup
run: |
curl -L -o innosetup.exe "https://jrsoftware.org/download.php/is.exe"
cmd /c "innosetup.exe /VERYSILENT /NORESTART"
- name: Build and Package
run: |
cd package
./make release
- 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: v${{ env.VERSION }}
name: v${{ env.VERSION }}
body: ${{ env.NOTES }}