Skip to content

Commit

Permalink
feat: create GitHub action for library release
Browse files Browse the repository at this point in the history
which is triggered manually with version as input.

Also remove "post-merge" action which releaset library when new tag was
pushed.

JIRA: STL-301
  • Loading branch information
sadam21 committed Apr 10, 2024
1 parent fd03ed5 commit 59b3ebe
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/post-merge.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---

on:
push:
tags:
- "gooddata-server-oauth2-*.*.*"
- "*.*.*"
workflow_dispatch:
inputs:
version:
type: string
required: true

jobs:
###########################
# BUILD & PUBLISH STAGE
###########################
test-kotlin:
release-library-kotlin:
runs-on: infra1-medium
steps:
- uses: actions/checkout@v3
Expand All @@ -19,12 +20,16 @@ jobs:
with:
key: kotlin-build
path: .gradle
- name: Get Tag Name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Publish to Nexus and to GitLab with Gradle Wrapper
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GITLAB_PACKAGES_UPLOAD_TOKEN: ${{ secrets.GITLAB_PACKAGES_UPLOAD_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
TAG_NAME: gooddata-server-oauth2-${{ github.event.inputs.version }}
run: |
echo "$VERSION" | grep -P '^\d+\.\d+\.\d+$'
git tag $TAG_NAME
git push origin $TAG_NAME
./gradlew clean publish -Pversion=$TAG_NAME --info

0 comments on commit 59b3ebe

Please sign in to comment.