Create and upload release #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create and upload release | |
| on: | |
| workflow_run: | |
| workflows: ["Python Package using pip"] | |
| types: | |
| - completed | |
| jobs: | |
| release: | |
| # Only run if the triggering run was for a tag starting with v | |
| if: > | |
| github.event.workflow_run.conclusion == 'success' && | |
| startsWith(github.event.workflow_run.head_branch, 'v') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download pytest-results artifact from previous workflow | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pytest-results | |
| run-id: ${{ github.event.workflow_run.id }} | |
| path: . | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: ${{ github.ref_name }} | |
| body: "Automated release." | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload to Release | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: pytest-results.zip | |
| asset_name: pytest-results.zip | |
| asset_content_type: application/zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |