Merge pull request #8 from TzuH-Hsu/dependabot/github_actions/actions… #36
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: | |
pull_request: | |
branches: [main] | |
push: | |
branches: ["main"] | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
issues: read | |
pull-requests: read | |
jobs: | |
Build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: poetry | |
- name: Install dependencies | |
run: poetry install | |
- name: Build with PyInstaller | |
run: poetry run pyinstaller -y Parquetizer.spec | |
- name: Rename executable | |
shell: bash | |
run: | | |
case ${{ matrix.os }} in | |
ubuntu-latest) | |
mv dist/Parquetizer dist/Parquetizer-linux;; | |
windows-latest) | |
mv dist/Parquetizer.exe dist/Parquetizer-windows.exe;; | |
macos-latest) | |
mv dist/Parquetizer dist/Parquetizer-macos;; | |
esac | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Parquetizer-${{ matrix.os }} | |
path: dist/Parquetizer-* | |
retention-days: 7 | |
Release: | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- name: Build Changelog | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
with: | |
configurationJson: | | |
{ | |
"template": "# What's Changed\n_#{{FROM_TAG}} (#{{FROM_TAG_DATE}}) ... #{{TO_TAG}} (#{{TO_TAG_DATE}})_\n#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>\n\n**Full Changelog**: #{{RELEASE_DIFF}}", | |
"pr_template": "- ##{{NUMBER}} #{{TITLE}} (@#{{AUTHOR}})", | |
"categories": [ | |
{ | |
"title": "## 🚀 Features", | |
"labels": ["feature", "enhancement"] | |
}, | |
{ | |
"title": "## 🐛 Bug Fixes", | |
"labels": ["bug", "fix"] | |
}, | |
{ | |
"title": "## 📝 Documentation", | |
"labels": ["documentation"] | |
}, | |
{ | |
"title": "## 📦 Dependencies", | |
"labels": ["dependencies"] | |
}, | |
{ | |
"title": "## ♾️ DevOps", | |
"labels": ["devops"] | |
} | |
] | |
} | |
ignorePreReleases: ${{ !contains(github.ref, '-rc') && !contains(github.ref, '-beta') && !contains(github.ref, '-alpha') }} | |
failOnError: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: false | |
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }} | |
body: ${{ steps.build_changelog.outputs.changelog }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
dist/Parquetizer-* |