@@ -24,84 +24,21 @@ defaults:
2424 shell : bash
2525
2626jobs :
27- release-sbt :
28- runs-on : ubuntu-latest
29- name : Release Scala artifacts
27+ publish :
28+ runs-on : ubuntu-22.04
3029 steps :
31- - name : Checkout code
32- uses : actions/checkout@v4
30+ - uses : actions/checkout@v4
3331 with :
34- ref : ${{ github.head_ref || github.ref_name }}
35-
36- - name : Prepare the release branch
37- run : |
38- VERSION=$(grep "ThisBuild / version" version.sbt | cut -d\" -f2 | sed 's/-SNAPSHOT//')
39- git config --global user.email "[email protected] " 40- git config --global user.name "CI/CD bot"
41- git checkout -b release/$VERSION
42- git push --set-upstream origin release/$VERSION
43-
44- - name : Setup JDK and sbt
45- 32+ fetch-depth : 0
33+ 4634 with :
4735 distribution : temurin
4836 java-version : 8
4937 cache : sbt
50-
51- - name : Install sbt
52- run : |
53- sudo apt-get update
54- sudo apt-get install apt-transport-https curl gnupg -yqq
55- echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
56- echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
57- curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
58- sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
59- sudo apt-get update
60- sudo apt-get install sbt
61-
62- - name : Import GPG Key
63- run : |
64- echo "${{ secrets.ABSA_OSS_CI_CD_BOT_GPG_KEY }}" > gpg-secret-key.asc
65- gpg --import --batch gpg-secret-key.asc && rm -rf gpg-secret-key.asc
66- mkdir -p ~/.gnupg
67-
68- - name : Setup SonaType config
69- run : |
70- mkdir -p ~/.sbt/1.0
71- echo "${{ secrets.SONATYPE_CONFIG }}" | base64 --decode > ~/.sbt/1.0/sonatype.sbt
72-
73- - name : Checkout the release branch
74- run : |
75- VERSION=$(grep "ThisBuild / version" version.sbt | cut -d\" -f2 | sed 's/-SNAPSHOT//')
76- git fetch origin release/$VERSION
77- git checkout release/$VERSION
78-
79- - name : Run the release plugin
80- run : sbt releaseNow
81-
82- create-pr :
83- needs : [ "release-sbt" ]
84- runs-on : ubuntu-latest
85- name : Create Pull Request
86-
87- steps :
88- - name : Checkout code
89- uses : actions/checkout@v4
90- with :
91- ref : ${{ github.head_ref || github.ref_name }}
92-
93- - name : Checkout the release branch
94- id : release_branch3
95- run : |
96- VERSION=$(grep "ThisBuild / version" version.sbt | cut -d\" -f2 | sed 's/-SNAPSHOT//')
97- echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
98- git config --global user.email "[email protected] " 99- git config --global user.name "CI/CD bot"
100- git fetch origin release/$VERSION
101- git checkout release/$VERSION
102-
103- - name : Create Pull Request
104- run : gh pr create -B master -H "release/$VERSION" --title "Release Cobrix v$VERSION" --body 'Created by Github action'
38+ - name : Build and release to Sonatype and Maven Central
39+ run : sbt ci-release
10540 env :
106- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
107- VERSION : ${{ steps.release_branch3.outputs.VERSION }}
41+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
42+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
43+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
44+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
0 commit comments