Skip to content

Commit a4619a1

Browse files
RahulHereRahulHere
authored andcommitted
Add GitHub Release creation to workflow
- Added automatic GitHub Release creation when pushing to feature/gopher-auth-build - Added option to create release on manual workflow dispatch - Release includes all 6 platform builds as downloadable assets - Release tag format: v{version}-{timestamp} (e.g., v0.1.0-20231220-143022) - Release body contains the build report with platform details - Uses softprops/action-gh-release action for release creation Now build artifacts will be available in GitHub Releases section for download.
1 parent 3cfce9f commit a4619a1

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

.github/workflows/build-all.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
required: false
1919
default: '0.1.0'
2020
type: string
21+
create_release:
22+
description: 'Create GitHub Release'
23+
required: false
24+
default: true
25+
type: boolean
2126

2227
env:
2328
BUILD_TYPE: ${{ github.event.inputs.build_type || 'Release' }}
@@ -215,7 +220,9 @@ jobs:
215220
name: Package All Artifacts
216221
runs-on: ubuntu-latest
217222
needs: [build-linux, build-windows, build-macos]
218-
if: github.event_name == 'push' && github.ref == 'refs/heads/feature/gopher-auth-build'
223+
if: |
224+
(github.event_name == 'push' && github.ref == 'refs/heads/feature/gopher-auth-build') ||
225+
(github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')
219226
220227
steps:
221228
- name: Checkout code
@@ -311,6 +318,34 @@ jobs:
311318
*.zip
312319
BUILD_REPORT.md
313320
retention-days: 30
321+
322+
- name: Generate release tag
323+
id: tag
324+
run: |
325+
# Generate tag based on version and timestamp
326+
VERSION="${{ env.LIB_VERSION }}"
327+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
328+
TAG="v${VERSION}-${TIMESTAMP}"
329+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
330+
echo "Release tag: ${TAG}"
331+
332+
- name: Create GitHub Release
333+
uses: softprops/action-gh-release@v1
334+
with:
335+
tag_name: ${{ steps.tag.outputs.tag }}
336+
name: libgopher_mcp_auth ${{ steps.tag.outputs.tag }}
337+
body_path: BUILD_REPORT.md
338+
draft: false
339+
prerelease: false
340+
files: |
341+
libgopher_mcp_auth-linux-x64.tar.gz
342+
libgopher_mcp_auth-linux-arm64.tar.gz
343+
libgopher_mcp_auth-windows-x64.zip
344+
libgopher_mcp_auth-windows-arm64.zip
345+
libgopher_mcp_auth-macos-x64.tar.gz
346+
libgopher_mcp_auth-macos-arm64.tar.gz
347+
env:
348+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
314349

315350
# Summary job
316351
summary:

0 commit comments

Comments
 (0)