mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 11:55:51 +00:00 
			
		
		
		
	Bumps [actions/checkout](https://github.com/actions/checkout) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08eba0b27e...08c6903cd8)
---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
		
	
		
			
				
	
	
		
			122 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			122 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Make release
 | 
						|
 | 
						|
on:
 | 
						|
  workflow_call:
 | 
						|
    inputs:
 | 
						|
      overwrite_release:
 | 
						|
        description: "Overwrite the current release and tag"
 | 
						|
        required: true
 | 
						|
        type: boolean
 | 
						|
 | 
						|
      prerelease:
 | 
						|
        description: "Create a prerelease"
 | 
						|
        required: true
 | 
						|
        type: boolean
 | 
						|
 | 
						|
      title:
 | 
						|
        description: "Release title"
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
 | 
						|
      version:
 | 
						|
        description: "Release version"
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
 | 
						|
      header:
 | 
						|
        description: "Release notes header"
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
 | 
						|
      generate_changelog:
 | 
						|
        description: "Generate changelog"
 | 
						|
        required: true
 | 
						|
        type: boolean
 | 
						|
 | 
						|
      draft:
 | 
						|
        description: "Create a draft release"
 | 
						|
        required: true
 | 
						|
        type: boolean
 | 
						|
 | 
						|
jobs:
 | 
						|
  release:
 | 
						|
    runs-on: heavy
 | 
						|
    container:
 | 
						|
      image: ghcr.io/xrplf/clio-ci:b2be4b51d1d81548ca48e2f2b8f67356b880c96d
 | 
						|
    env:
 | 
						|
      GH_REPO: ${{ github.repository }}
 | 
						|
      GH_TOKEN: ${{ github.token }}
 | 
						|
 | 
						|
    permissions:
 | 
						|
      contents: write
 | 
						|
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
 | 
						|
        with:
 | 
						|
          fetch-depth: 0
 | 
						|
 | 
						|
      - name: Prepare runner
 | 
						|
        uses: XRPLF/actions/.github/actions/prepare-runner@7951b682e5a2973b28b0719a72f01fc4b0d0c34f
 | 
						|
        with:
 | 
						|
          disable_ccache: true
 | 
						|
 | 
						|
      - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
 | 
						|
        with:
 | 
						|
          path: release_artifacts
 | 
						|
          pattern: clio_server_*
 | 
						|
 | 
						|
      - name: Create release notes
 | 
						|
        shell: bash
 | 
						|
        env:
 | 
						|
          RELEASE_HEADER: ${{ inputs.header }}
 | 
						|
        run: |
 | 
						|
          echo "# Release notes" > "${RUNNER_TEMP}/release_notes.md"
 | 
						|
          echo "" >> "${RUNNER_TEMP}/release_notes.md"
 | 
						|
          printf '%s\n' "${RELEASE_HEADER}" >> "${RUNNER_TEMP}/release_notes.md"
 | 
						|
 | 
						|
      - name: Generate changelog
 | 
						|
        shell: bash
 | 
						|
        if: ${{ inputs.generate_changelog }}
 | 
						|
        run: |
 | 
						|
          LAST_TAG="$(gh release view --json tagName -q .tagName --repo XRPLF/clio)"
 | 
						|
          LAST_TAG_COMMIT="$(git rev-parse $LAST_TAG)"
 | 
						|
          BASE_COMMIT="$(git merge-base HEAD $LAST_TAG_COMMIT)"
 | 
						|
          git-cliff "${BASE_COMMIT}..HEAD" --ignore-tags "nightly|-b|-rc"
 | 
						|
          cat CHANGELOG.md >> "${RUNNER_TEMP}/release_notes.md"
 | 
						|
 | 
						|
      - name: Prepare release artifacts
 | 
						|
        shell: bash
 | 
						|
        run: .github/scripts/prepare-release-artifacts.sh release_artifacts
 | 
						|
 | 
						|
      - name: Upload release notes
 | 
						|
        uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
 | 
						|
        with:
 | 
						|
          name: release_notes_${{ inputs.version }}
 | 
						|
          path: "${RUNNER_TEMP}/release_notes.md"
 | 
						|
 | 
						|
      - name: Remove current release and tag
 | 
						|
        if: ${{ github.event_name != 'pull_request' && inputs.overwrite_release }}
 | 
						|
        shell: bash
 | 
						|
        env:
 | 
						|
          RELEASE_VERSION: ${{ inputs.version }}
 | 
						|
        run: |
 | 
						|
          gh release delete "${RELEASE_VERSION}" --yes || true
 | 
						|
          git push origin :"${RELEASE_VERSION}" || true
 | 
						|
 | 
						|
      - name: Publish release
 | 
						|
        if: ${{ github.event_name != 'pull_request' }}
 | 
						|
        shell: bash
 | 
						|
        env:
 | 
						|
          RELEASE_VERSION: ${{ inputs.version }}
 | 
						|
          PRERELEASE_OPTION: ${{ inputs.prerelease && '--prerelease' || '' }}
 | 
						|
          RELEASE_TITLE: ${{ inputs.title }}
 | 
						|
          DRAFT_OPTION: ${{ inputs.draft && '--draft' || '' }}
 | 
						|
        run: |
 | 
						|
          gh release create "${RELEASE_VERSION}" \
 | 
						|
            ${PRERELEASE_OPTION} \
 | 
						|
            --title "${RELEASE_TITLE}" \
 | 
						|
            --target "${GITHUB_SHA}" \
 | 
						|
            ${DRAFT_OPTION} \
 | 
						|
            --notes-file "${RUNNER_TEMP}/release_notes.md" \
 | 
						|
            ./release_artifacts/clio_server*
 |