Skip to content

Commit 0e17d01

Browse files
cd: create workflow to trigger release on GitHub (#171)
* cd: create callable action for creating release on GItHub * cd: call action to create release on GitHub
1 parent bfe1c57 commit 0e17d01

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: github-release
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tag:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
create-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- name: Create GitHub release
16+
run: |
17+
curl -L \
18+
-X POST \
19+
-H "Accept: application/vnd.github+json" \
20+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
21+
-H "X-GitHub-Api-Version: 2022-11-28" \
22+
https://api.github.com/repos/spotify/github-java-client/releases \
23+
-d '{"tag_name":"${{ inputs.tag }}","target_commitish":"master","draft":false,"prerelease":false,"generate_release_notes":true}'

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,12 @@ jobs:
4444
uses: codecov/codecov-action@v3
4545
with:
4646
token: ${{ secrets.CODECOV_TOKEN }}
47+
48+
49+
trigger-github-release:
50+
needs: build
51+
name: Trigger GitHub release workflow
52+
if: github.ref_type == 'tag'
53+
uses: ./.github/workflows/release-on-github.yml
54+
with:
55+
tag: ${{ github.ref_name }}

0 commit comments

Comments
 (0)