pull_request #4514
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: "[Auto] Forgejo Pull Request" | |
| on: | |
| repository_dispatch: | |
| types: [pull_request] | |
| env: | |
| DISABLE_ARM: ${{ vars.DISABLE_ARM }} | |
| FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} | |
| jobs: | |
| build: | |
| name: Build | |
| concurrency: | |
| group: pull_request-${{ github.event.client_payload.number }} | |
| cancel-in-progress: true | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| build-id: 'pull_request' | |
| secrets: inherit | |
| release: | |
| name: "Create Release" | |
| needs: [build] | |
| permissions: | |
| actions: read | |
| security-events: write | |
| contents: write | |
| discussions: write | |
| env: | |
| GH_TOKEN: "${{ secrets.CUSTOM_GITHUB_TOKEN }}" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| - name: Download artifacts | |
| uses: actions/[email protected] | |
| - name: Load payload environment | |
| shell: bash | |
| run: | | |
| export FORGEJO_LENV=forgejo-env/forgejo.env | |
| . ./.ci/fj/load-env.sh | |
| - name: Set environment variables | |
| run: | | |
| echo "DEVEL=true" >> $GITHUB_ENV | |
| - name: Package artifacts nicely | |
| run: | | |
| export ID=${FORGEJO_PR_NUMBER}-${FORGEJO_REF} | |
| ./.ci/common/pack.sh | |
| - name: Generate changelog | |
| run: | | |
| ./.ci/changelog/generate.sh pull_request > changelog.md | |
| - name: Delete Previous Release | |
| run: | | |
| if [ -n "$GH_TOKEN" ]; then | |
| gh release delete "$FORGEJO_PR_NUMBER" --repo "$RELEASE_PR_REPO" --cleanup-tag -y | |
| sleep 5 | |
| else | |
| echo "No CUSTOM_GITHUB_TOKEN provided, skipping release..." | |
| fi | |
| continue-on-error: true | |
| - name: Release (sha) | |
| id: release | |
| if: ${{ env.GH_TOKEN }} | |
| uses: softprops/[email protected] | |
| with: | |
| name: "${{ env.FORGEJO_PR_TITLE }}" | |
| tag_name: ${{ env.FORGEJO_PR_NUMBER }}-${{ env.FORGEJO_REF }} | |
| repository: ${{ env.RELEASE_PR_REPO }} | |
| body_path: ./changelog.md | |
| token: ${{ env.GH_TOKEN }} | |
| prerelease: false | |
| draft: false | |
| generate_release_notes: false | |
| fail_on_unmatched_files: false | |
| make_latest: true | |
| files: | | |
| artifacts/* | |
| - name: Release (PR) | |
| if: ${{ env.GH_TOKEN }} | |
| uses: softprops/[email protected] | |
| with: | |
| name: ${{ env.FORGEJO_PR_TITLE }} | |
| tag_name: ${{ env.FORGEJO_PR_NUMBER }} | |
| repository: ${{ env.RELEASE_PR_REPO }} | |
| body_path: ./changelog.md | |
| token: ${{ env.GH_TOKEN }} | |
| prerelease: false | |
| draft: false | |
| generate_release_notes: false | |
| fail_on_unmatched_files: false | |
| discussion_category_name: "PRs" | |
| make_latest: true | |
| - name: Add release URL to summary | |
| run: | | |
| { | |
| echo "## Release Summary" | |
| echo "" | |
| echo "- View Release on GitHub: [#${{ env.FORGEJO_PR_NUMBER }}](${{ steps.release.outputs.url }})" | |
| echo "" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Send release URL to status | |
| run: | | |
| python3 ./.ci/common/status.py release ${{ steps.release.outputs.url }} |