Version 1.6.17 #86
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 Publish | |
on: | |
release: | |
types: [created] | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build-and-release: | |
if: "contains(github.event.head_commit.message, 'Version')" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
architecture: 'x86' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel twine | |
python -m pip install Pyinstaller | |
python -m pip install mutagen tqdm coloredlogs | |
python -m pip install build requests setuptools wheel | |
- name: Build package | |
run: python -m build --no-isolation | |
- name: Publish package | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_2 }} | |
run: | | |
twine upload ./dist/*.whl --skip-existing | |
twine upload ./dist/*.tar.gz --skip-existing | |
- name: Build Windows executables | |
run: | | |
pyinstaller -F -i NONE pyncm/__main__.py --name pyncm | |
- name : Get Version | |
id : get_version | |
run : | | |
$message = @(git log -1 --oneline --format=%s) | |
$lines = $message.Split(' ') | |
$version = $lines[1] | |
Write-Output "::set-output name=version::$version" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.version }} | |
release_name: Version ${{ steps.get_version.outputs.version }} | |
- uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/pyncm.exe | |
asset_name: pyncm.exe | |
asset_content_type: application/application/vnd.microsoft.portable-executable | |
- uses: eregon/publish-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} |