Skip to content

Commit

Permalink
ci: create-new-release.yml - introduce build stage to a workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
noritakaIzumi committed Nov 4, 2024
1 parent c480fc8 commit bbcf5f9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 23 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-pip-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build pip package

on:
workflow_call:
inputs:
version:
description: Version string from hatch
type: string
required: true

env:
app-name: "chronovoyage"

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Hatch
uses: pypa/hatch@install

- name: Build Package
run: hatch build -c

- name: Upload artifacts (sdist)
uses: actions/upload-artifact@v4
with:
name: pip-package--sdist
path: dist/${{ env.app-name }}-${{ inputs.version }}.tar.gz

- name: Upload artifacts (wheel)
uses: actions/upload-artifact@v4
with:
name: pip-package--wheel
path: dist/${{ env.app-name }}-${{ inputs.version }}-py3-none-any.whl
24 changes: 1 addition & 23 deletions .github/workflows/create-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
push:

env:
app-name: "chronovoyage"
tag-prefix: "v"

jobs:
Expand Down Expand Up @@ -45,30 +44,9 @@ jobs:
echo "tag=${tag}" >> $GITHUB_OUTPUT
build-package:
runs-on: ubuntu-latest
needs:
- push-tag
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Hatch
uses: pypa/hatch@install

- name: Build Package
run: hatch build -c

- name: Upload artifacts (sdist)
uses: actions/upload-artifact@v4
with:
name: pip-package--sdist
path: dist/${{ env.app-name }}-${{ needs.push-tag.outputs.version }}.tar.gz

- name: Upload artifacts (wheel)
uses: actions/upload-artifact@v4
with:
name: pip-package--wheel
path: dist/${{ env.app-name }}-${{ needs.push-tag.outputs.version }}-py3-none-any.whl
uses: ./.github/workflows/build-pip-package.yml

create-release:
name: Create a release
Expand Down

0 comments on commit bbcf5f9

Please sign in to comment.