Skip to content

Commit

Permalink
Add release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
solodkiy committed Sep 29, 2024
1 parent e62781a commit 356ce9d
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI Workflow
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
Expand Down Expand Up @@ -40,5 +40,37 @@ jobs:
path: gauge-exporter
retention-days: 1

release:
name: Release Application
runs-on: ubuntu-latest
needs: [compile] # Ensure release only happens after compile
if: startsWith(github.ref, 'refs/tags/') # Only run on tags
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: gauge-exporter

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gauge-exporter
asset_name: gauge-exporter
asset_content_type: application/octet-stream

0 comments on commit 356ce9d

Please sign in to comment.