Skip to content

Commit d0d202c

Browse files
committed
Add a GitHub action for the release.
1 parent fd79310 commit d0d202c

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# temporary
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
release-sbt:
12+
runs-on: ubuntu-latest
13+
name: Release Scala Artifacts
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: main
20+
21+
- name: Setup Scala
22+
uses: olafurpg/setup-scala@v14
23+
with:
24+
java-version: "adopt@1.8"
25+
26+
- name: Import GPG Key
27+
shell: bash
28+
run: |
29+
echo "${{ secrets.SONATYPE_GPG_KEY }}" > gpg-secret-key.asc
30+
gpg --import --batch gpg-secret-key.asc && rm -rf gpg-secret-key.asc
31+
git config --global user.email "absa_ci_cd_bot@absa.africa"
32+
git config --global user.name "CI/CD bot"
33+
34+
- name: Setup SonaType config
35+
shell: bash
36+
run: |
37+
mkdir -p ~/.sbt/1.0
38+
echo "${{ secrets.SONATYPE_CONFIG }}" | base64 --decode > ~/.sbt/1.0/sonatype.sbt
39+
40+
- name: Run the release plugin
41+
working-directory: ./pramen
42+
run: |
43+
export GPG_TTY=$(tty)
44+
sbt releaseNow
45+
46+
- name: Create Pull Request
47+
uses: peter-evans/create-pull-request@v3
48+
with:
49+
commit-message: "Release version ${{ steps.release.outputs.version }}"
50+
branch: release/${{ steps.release.outputs.version }}
51+
title: "Release version ${{ steps.release.outputs.version }}"
52+
body: "Automated release created by GitHub Action."
53+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)