diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55565583..0481715e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,6 @@ jobs: package: + needs: release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -16,7 +17,28 @@ jobs: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} TWINE_USERNAME: ${{ vars.TWINE_USERNAME }} run: make upload - pages-build-with-release: + release: + needs: pages-build + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download changelog + uses: actions/download-artifact@v3 + with: + name: changelog + path: docs/changelog.md + - name: Install git-changelog using pipx + run: pipx install git-changelog + - name: Prepare release notes + run: make release-notes + - name: Create GitHub release + uses: softprops/action-gh-release@v1 + with: + body_path: release-notes.md + prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') }} + pages-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -30,18 +52,17 @@ jobs: - run: env | sort - run: make dev-docs - run: make docs - - run: make release-notes > release-notes.md - - name: Create GitHub release - uses: softprops/action-gh-release@v1 + - name: Upload changelog + uses: actions/upload-artifact@v3 with: - body_path: release-notes.md - prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') }} + name: changelog + path: docs/changelog.md - name: Upload pages artifact uses: actions/upload-pages-artifact@v2 with: path: public pages-deploy: - needs: pages-build-with-release + needs: release permissions: pages: write id-token: write diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja index 4968fffa..d84cabd5 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja @@ -1,5 +1,6 @@ jobs: package: + needs: release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -16,7 +17,28 @@ jobs: TWINE_PASSWORD: {{ '${{ secrets.TWINE_PASSWORD }}' }} TWINE_USERNAME: {{ '${{ vars.TWINE_USERNAME }}' }} run: make upload - pages-build-with-release: + release: + needs: pages-build + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download changelog + uses: actions/download-artifact@v3 + with: + name: changelog + path: docs/changelog.md + - name: Install git-changelog using pipx + run: pipx install git-changelog + - name: Prepare release notes + run: make release-notes + - name: Create GitHub release + uses: softprops/action-gh-release@v1 + with: + body_path: release-notes.md + prerelease: {{ '${{ startsWith(github.ref, \'refs/tags/v0\') }}' }} + pages-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -26,22 +48,21 @@ jobs: uses: actions/setup-python@v4 with: cache: pip - python-version: '3.11' + python-version: '{{ default_py }}' - run: env | sort - run: make dev-docs - run: make docs - - run: make release-notes > release-notes.md - - name: Create GitHub release - uses: softprops/action-gh-release@v1 + - name: Upload changelog + uses: actions/upload-artifact@v3 with: - body_path: release-notes.md - prerelease: {{ '${{ startsWith(github.ref, \'refs/tags/v0\') }}' }} + name: changelog + path: docs/changelog.md - name: Upload pages artifact uses: actions/upload-pages-artifact@v2 with: path: public pages-deploy: - needs: pages-build-with-release + needs: release permissions: pages: write id-token: write