Improve publish-a-release.yaml workflow

This commit is contained in:
Sina Atalay
2025-02-08 18:29:17 -05:00
parent 3c66fdc881
commit 6e0629c1ab
2 changed files with 51 additions and 22 deletions

View File

@@ -11,10 +11,50 @@ jobs:
name: Run Tests
uses: ./.github/workflows/test.yaml
call_create_executables_workflow:
name: Create Executables
needs:
- call_test_workflow
uses: ./.github/workflows/create-executables.yaml
upload_release_files:
name: Create release files
needs:
- call_create_executables_workflow
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download the executables
uses: actions/download-artifact@v4
- name: Checkout the repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Build
run: |
hatch build
- name: Upload the executables as release assets
uses: softprops/action-gh-release@v2
with:
files: |
renderc-*/rendercv-linux-ARM64
renderc-*/rendercv-linux-x86_64
renderc-*/rendercv-macos-ARM64
renderc-*/rendercv-windows-x86_64.exe
dist/rendercv-*.tar.gz
dist/rendercv-*.whl
publish_to_pypi:
name: Publish to PyPI
needs:
- call_test_workflow
- upload_release_files
runs-on: ubuntu-latest
environment: release
permissions:
@@ -95,26 +135,7 @@ jobs:
call_update_files_workflow:
name: Update files
needs:
- publish_to_pypi
uses: ./.github/workflows/update-files.yaml
call_create_executables_workflow:
name: Create Executables
needs:
- publish_to_dockerhub_and_ghcr
- publish_to_pypi
uses: ./.github/workflows/create-executables.yaml
upload_release_files:
name: Create release files
needs:
- publish_to_pypi
- call_create_executables_workflow
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download the executables
uses: actions/download-artifact@v2
with:
name: executables

View File

@@ -43,6 +43,12 @@ def create_executable():
"darwin": "macos",
"win32": "windows",
}
machine_name = {
"AMD64": "x86_64",
"x86_64": "x86_64",
"aarch64": "ARM64",
"arm64": "ARM64",
}
executable_path = {
"linux": root / "bin" / "rendercv",
"darwin": root / "bin" / "rendercv",
@@ -51,8 +57,10 @@ def create_executable():
new_executable_path = (
root
/ "bin"
/ f"rendercv-{platform_name[sys.platform]}-{platform.machine()}"
/ f"rendercv-{platform_name[sys.platform]}-{machine_name[platform.machine()]}"
)
if sys.platform == "win32":
new_executable_path = new_executable_path.with_suffix(".exe")
executable_path[sys.platform].rename(new_executable_path)
print('Executable created at "bin" folder.') # NOQA: T201