Skip to content

Commit

Permalink
chore(ci): add github release for SDK (#1540)
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCiesla authored Feb 16, 2025
1 parent 47d9064 commit 5d90ba2
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/publish_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,26 @@ jobs:

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
toolchain: stable
override: true

- name: publish
run: |
cargo login "${{ secrets.CARGO_REGISTRY_TOKEN }}"
cargo publish -p iggy
github_release:
uses: ./.github/workflows/release_sdk.yml
needs: tag
if: ${{ needs.tag.outputs.tag_created == 'true' }}
with:
tag_name: "iggy-${{ needs.tag.outputs.iggy_version }}"

finalize_sdk:
runs-on: ubuntu-latest
needs:
- publish
- github_release
if: always()
steps:
- uses: actions/checkout@v4
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/release_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: release_sdk

on:
workflow_call:
inputs:
tag_name:
description: 'The name of the tag to be released'
required: true
type: string

env:
GITHUB_TOKEN: ${{ github.token }}

jobs:
release_sdk:
name: Release SDK
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create Changelog
uses: orhun/git-cliff-action@v4
id: changelog
with:
config: cliff.toml
args: -vv --latest
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.content }}
files: |
CHANGELOG.md
tag_name: ${{ inputs.tag_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

finalize_release:
name: Finalize release
runs-on: ubuntu-latest
needs:
- release_sdk
if: always()
steps:
- name: Everything is fine
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0

- name: Some checks failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

0 comments on commit 5d90ba2

Please sign in to comment.