Merge pull request #12 from sumeshi/feature/v0.3.6 #21
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: publish-release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
outputs: | |
version: ${{ steps.create_tag.outputs.version }} | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: install python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install uv | |
- name: Get version | |
id: get_version | |
run: | | |
version=$(cat pyproject.toml | grep version | head -1 | awk -F '"' '{print $2}') | |
echo "version=$version" >> $GITHUB_ENV | |
shell: bash | |
- name: build | |
run: | | |
uv add --dev nuitka | |
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv-$version.exe --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py | |
shell: bash | |
- name: verify | |
run: | | |
dist/qsv-$version.exe -h | |
shell: bash | |
- name: create tag | |
id: create_tag | |
if: startsWith(github.ref, 'refs/heads/main') | |
run: | | |
git tag "v$version" | |
git push origin "v$version" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
- name: create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ steps.create_tag.outputs.version }} | |
files: dist/qsv-${{ steps.create_tag.outputs.version }}.exe | |
name: Release v${{ steps.create_tag.outputs.version }} | |
body: 'This release was automatically created by GitHub Actions.' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-linux: | |
needs: build-windows | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
env: | |
version: ${{ needs.build-windows.outputs.version }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: install python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt install -y patchelf | |
pip install uv | |
- name: build | |
run: | | |
uv add --dev nuitka | |
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv-$version --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py | |
- name: verify | |
run: | | |
dist/qsv-$version -h | |
- name: upload asset to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ needs.build-windows.outputs.version }} | |
files: dist/qsv-${{ needs.build-windows.outputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |