test: github action.3 #3
Workflow file for this run
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: Release Build | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.12 | |
volumes: | |
- /tmp/build:/build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
path: src | |
- name: Clean repository | |
run: | | |
mkdir -p /build/scripts | |
mv src/* /build/scripts/ | |
rm -rf /build/scripts/.git | |
find /build/scripts -name '__pycache__' -exec rm -rf {} + | |
find /build/scripts -name '*.pyc' -delete | |
- name: Compose Release Notes | |
id: compose_notes | |
run: | | |
TAG_NAME="${GITHUB_REF#refs/tags/}" | |
echo "version: $TAG_NAME" | |
base=$(cat /build/scripts/docs/_github/release_notes.md) | |
case "$TAG_NAME" in | |
*beta*) | |
extra=$(cat /build/scripts/docs/_github/preset_preview.md) | |
echo "is_beta=true" >> $GITHUB_OUTPUT | |
;; | |
*) | |
extra=$(cat /build/scripts/docs/_github/preset_stable.md) | |
echo "is_beta=false" >> $GITHUB_OUTPUT | |
;; | |
esac | |
echo "$base\n$extra" > /build/full_body.md | |
- name: Setup Python | |
run: python -m pip install pydos2unix py7zr tqdm loguru | |
- name: Download Presets | |
run: | | |
wget -O /tmp/CGS_preset.7z \ | |
https://github.com/jasoneri/imgur/releases/download/preset/CGS_preset.7z | |
wget -O /tmp/CGS-macOS_preset.7z \ | |
https://github.com/jasoneri/imgur/releases/download/preset/CGS-macOS_preset.7z | |
- name: Build packages | |
working-directory: /build | |
run: | | |
python scripts/deploy/packer.py windows | |
python scripts/deploy/packer.py mac | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
name: ${{ github.ref_name }} | |
prerelease: ${{ steps.compose_notes.outputs.is_beta == 'true' }} | |
body_path: /build/full_body.md | |
files: | | |
/build/CGS.7z | |
/build/CGS-macOS.7z | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |