GitHub Release (Run ID: latest build) #5
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 GitHub Release | |
| run-name: "GitHub Release (Run ID: ${{ inputs.run_id || 'latest build' }})" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| prerelease: | |
| description: "Mark as pre-release" | |
| required: true | |
| type: boolean | |
| default: false | |
| run_id: | |
| description: "Build workflow run ID (leave empty to use latest)" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Get Latest Build Run ID | |
| id: get-run-id | |
| uses: ./.github/actions/get-latest-build-run-id | |
| with: | |
| run_id: ${{ inputs.run_id }} | |
| github_token: ${{ github.token }} | |
| - name: Download Server Artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: Server | |
| path: ./server-publish | |
| github-token: ${{ github.token }} | |
| run-id: ${{ steps.get-run-id.outputs.run_id }} | |
| - name: Download docker-compose file | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: DockerCompose | |
| path: ./docker-compose-download | |
| github-token: ${{ github.token }} | |
| run-id: ${{ steps.get-run-id.outputs.run_id }} | |
| - name: Get Version from Version.txt | |
| id: get-version | |
| shell: bash | |
| run: | | |
| VERSION=$(cat ./server-publish/wwwroot/downloads/Version.txt) | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Copy OpenAPI Spec | |
| shell: bash | |
| run: | | |
| cp ./server-publish/ControlR.Web.Server.json ./ControlR.Web.Server.json | |
| - name: Prepare Release Artifacts | |
| shell: bash | |
| run: | | |
| # Create server zip | |
| cd server-publish | |
| zip -r ../server-linux-amd64.zip . | |
| cd .. | |
| cp docker-compose-download/docker-compose.yml . | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: v${{ steps.get-version.outputs.VERSION }} Release | |
| tag_name: v${{ steps.get-version.outputs.VERSION }} | |
| draft: true | |
| prerelease: ${{ inputs.prerelease }} | |
| generate_release_notes: true | |
| body: | | |
| ## Breaking Changes: | |
| - | |
| ## Changes: | |
| - | |
| files: | | |
| server-linux-amd64.zip | |
| ControlR.Web.Server.json | |
| docker-compose.yml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Release Created | |
| run: | | |
| echo "## Release Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "**Version:** v${{ steps.get-version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Status:** Draft" >> $GITHUB_STEP_SUMMARY | |
| echo "**Pre-release:** ${{ inputs.prerelease }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "⚠️ Release is in DRAFT mode - review and publish when ready" >> $GITHUB_STEP_SUMMARY |