Skip to content

Commit

Permalink
fix workflows 2
Browse files Browse the repository at this point in the history
Signed-off-by: TheBossMagnus <TheBossMagnus@proton.me>
  • Loading branch information
TheBossMagnus committed Sep 18, 2024
1 parent f8f0ad5 commit 35e0192
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 16 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller aiohttp setuptools wheel build twine
pip install pyinstaller aiohttp
- name: Get commit SHA
id: commit_sha
Expand All @@ -32,11 +32,4 @@ jobs:
with:
name: Modpack-Changelogger-${{ env.sha }}
path: dist/ModpackChangelogger*

- name: Build the package
run: python -m build

- name: Publish to PyPI
run: |
python -m pip install twine
twine upload dist/*

71 changes: 71 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller aiohttp setuptools wheel build twine
- name: Get release tag
id: get_tag
run: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
shell: bash

- name: Build with PyInstaller
run: |
pyinstaller --onefile --icon=NONE --name ModpackChangelogger-${{ env.RELEASE_TAG }} modpack_changelogger.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Modpack-Changelogger-${{ env.RELEASE_TAG }}
path: dist/ModpackChangelogger*

- name: Upload to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/ModpackChangelogger-${{ env.RELEASE_TAG }}.exe
asset_name: ModpackChangelogger-${{ env.RELEASE_TAG }}.exe
asset_content_type: application/octet-stream



upload_and_publish:
name: Publish release to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: "https://pypi.org/p/modpack-changelogger"
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion Project Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. Betas won't
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1](https://github.com/TheBossMagnus/ModpackChangelogger/releases/tag/1.0.1) - 2024-09-17
## [1.0.1](https://github.com/TheBossMagnus/ModpackChangelogger/releases/tag/1.0.1) - 2024-09-18
### Changed
* Pypi builds are now made on Github Actions
* Migrated from setup.py to pyproject.toml
Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "modpack_changelogger"
version = "0.1.1"
name = "modpack-changelogger"
version = "1.0.1"
description = "A powerful and customizable Python tool to generate a changelog between two Minecraft modpacks in modrinth.mrpack or curseforge.zip format."
readme = "README.md"
requires-python = ">=3.8"
Expand All @@ -22,7 +22,6 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]

[project.dependencies]
dependencies = ["aiohttp>=3.9.5"]

[project.scripts]
Expand All @@ -36,6 +35,6 @@ package-dir = {"" = "src"}

[tool.ruff]
line-length = 100
lint.select = ["E", "F", "W", "C90"]
lint.ignore = ["E501"]
lint.exclude = ["tests/*"]
select = ["E", "F", "W", "C90"]
ignore = ["E501"]
exclude = ["tests/*"]

0 comments on commit 35e0192

Please sign in to comment.