diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 78de885..fc6b6d3 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,8 +9,11 @@ name: Upload Python Package on: - release: - types: [published] + workflow_run: + workflows: ["Build and Release"] + types: + - completed + workflow_dispatch: jobs: deploy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6b673c6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Build and Release + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + changelog: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Upload artifact with CHANGELOG + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-changelog + path: CHANGELOG.md + + release: + needs: [changelog] + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: ./downloaded-app-artifacts + + - name: Check location + run: | + ls -la + ls -la ./downloaded-app-artifacts + ls -la ./downloaded-app-artifacts/ubuntu-latest-changelog + + - name: Generate info + run: | + echo "## Summary" > info.md + awk '/^## /{if (p) exit; p=1; next} p' ./downloaded-app-artifacts/ubuntu-latest-changelog/CHANGELOG.md >> info.md + + - name: Check location + run: | + ls -la + ls -la ./downloaded-app-artifacts + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + body_path: info.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}