Merge pull request #5 from sumeshi/feature/v0.3.3 #11
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: build | |
run: | | |
uv add --dev nuitka | |
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv.exe --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py | |
- name: verify | |
run: | | |
dist/qsv.exe -h | |
- name: create tag | |
id: create_tag | |
if: startsWith(github.ref, 'refs/heads/main') | |
run: | | |
version=$(cat pyproject.toml | grep version | head -1 | awk -F '"' '{print $2}') | |
git tag "v$version" | |
git push origin "v$version" | |
echo "version=v$version" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
- name: create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.create_tag.outputs.version }} | |
files: dist/qsv.exe | |
name: Release ${{ 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'] | |
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 patchelf | |
pip install uv | |
- name: build | |
run: | | |
uv add --dev nuitka | |
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py | |
- name: verify | |
run: | | |
dist/qsv -h | |
- name: upload asset to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.build-windows.outputs.version }} | |
files: dist/qsv | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |