Skip to content

Commit

Permalink
modify workflow action
Browse files Browse the repository at this point in the history
  • Loading branch information
aastha25 committed Feb 13, 2024
1 parent deca51f commit e6d541a
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: CI

on:
push:
branches: ['master']
branches: ['master', 'li-trino-hotfix']
tags-ignore: [v*] # release tags are autogenerated after a successful CI, no need to run CI against them
pull_request:
branches: ['**']
Expand All @@ -35,7 +35,7 @@ jobs:
- name: 3. Perform build
run: ./gradlew -i build

- name: 4. Perform release
- name: 4. Perform release for master branch if commit is on master
# Release job, only for pushes to the main development branch
if: github.event_name == 'push'
&& github.ref == 'refs/heads/master'
Expand All @@ -49,3 +49,26 @@ jobs:
SONATYPE_PWD: ${{secrets.SONATYPE_PWD}}
PGP_KEY: ${{secrets.PGP_KEY}}
PGP_PWD: ${{secrets.PGP_PWD}}

- name: 5. Derive version for li-trino-hotfix
if: github.ref == 'refs/heads/li-trino-hotfix'
run: |
branch_name="${{ github.ref#refs/heads/ }}"
echo "branch_name=${branch_name}" >> $GITHUB_ENV
echo "DERIVED_VERSION=2.2.27-${branch_name}" >> $GITHUB_ENV
- name: 6. Perform release for li-trino-hotfix branch if commit is this branch
# Release job, only for pushes to the main development branch
if: github.event_name == 'push'
&& github.ref == 'refs/heads/li-trino-hotfix'
&& github.repository == 'linkedin/coral'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')

run: ./gradlew githubRelease publishToSonatype closeAndReleaseStagingRepository --stacktrace -Pversion="${{ env.DERIVED_VERSION }}"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONATYPE_USER: ${{secrets.SONATYPE_USER}}
SONATYPE_PWD: ${{secrets.SONATYPE_PWD}}
PGP_KEY: ${{secrets.PGP_KEY}}
PGP_PWD: ${{secrets.PGP_PWD}}

0 comments on commit e6d541a

Please sign in to comment.