Skip to content

ci: create-new-release.yml - fix upload path #20

ci: create-new-release.yml - fix upload path

ci: create-new-release.yml - fix upload path #20

name: Create new release
on:
pull_request:
branches:
- main
types:
- closed
push:
jobs:
push-tag:
name: Push a tag
# if: ${{ contains(github.event.pull_request.labels.*.name, 'new release') && github.event.pull_request.merged }}
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.value }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Configure git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Push a tag
id: tag
run: |
tag="v$(hatch version)"
git tag -a ${tag} -m "New release ${tag} (tagged by github-actions[bot])"
git push origin ${tag}
echo "value=${tag}" >> $GITHUB_OUTPUT
test:
uses: ./.github/workflows/test.yml
build-package:
runs-on: ubuntu-latest
needs:
- test
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
uses: actions/upload-artifact@v4
with:
path: 'dist/*'
create-release:
name: Create a release
runs-on: ubuntu-latest
needs:
- push-tag
- build-package
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/*
- name: List dist directory
run: |
ls -la dist
exit 1
- name: Create a release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ needs.push-tag.outputs.tag }}
generate_release_notes: true