Skip to content

Commit 6dc598e

Browse files
committed
IO
1 parent 5be8477 commit 6dc598e

4 files changed

Lines changed: 76 additions & 22 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sonatype Zinc 1.x release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
io_ver:
6+
description: the version of sbt to release
7+
required: true
8+
default: 1.12.x
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
java: 8
17+
distribution: zulu
18+
runs-on: ${{ matrix.os }}
19+
env:
20+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M
21+
IO_VER: ${{ github.event.inputs.io_ver }}
22+
steps:
23+
- name: Checkout sbt/sbt-dist
24+
uses: actions/checkout@v7
25+
- name: Checkout sbt/io
26+
uses: actions/checkout@v7
27+
with:
28+
repository: sbt/io
29+
ref: v${{ github.event.inputs.io_ver }}
30+
path: io
31+
- name: Setup JDK
32+
uses: actions/setup-java@v5
33+
with:
34+
distribution: "${{ matrix.distribution }}"
35+
java-version: "${{ matrix.java }}"
36+
- uses: sbt/setup-sbt@v1
37+
- name: Build
38+
shell: bash
39+
run: |
40+
mode=sonatype_io bin/run-ci.sh
41+
env:
42+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
43+
SONATYPE_PASS: ${{ secrets.SONATYPE_PASS }}
44+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
45+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
46+
RELEASE_COMMAND: "+publishSigned sonaUpload"

‎.github/workflows/sonatype_zinc.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: Checkout sbt/sbt-dist
2424
uses: actions/checkout@v7
25-
- name: Checkout sbt/sbt
25+
- name: Checkout sbt/zinc
2626
uses: actions/checkout@v7
2727
with:
2828
repository: sbt/zinc

‎.github/workflows/sonatype_zinc_1.x.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: Checkout sbt/sbt-dist
2424
uses: actions/checkout@v7
25-
- name: Checkout sbt/sbt
25+
- name: Checkout sbt/zinc
2626
uses: actions/checkout@v7
2727
with:
2828
repository: sbt/zinc

‎bin/run-ci.sh‎

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,45 @@ releaseNightly() {
6161
popd
6262
}
6363

64-
releaseSonatype() {
65-
pushd sbt
64+
setupSonatype() {
65+
mkdir -p $HOME/.sbt/
66+
echo "host = central.sonatype.com" > $HOME/.sbt/credentials
67+
echo "user = $SONATYPE_USER" >> $HOME/.sbt/credentials
68+
echo "password = $SONATYPE_PASS" >> $HOME/.sbt/credentials
69+
}
6670

71+
releaseSonatypeCommon() {
6772
installGpgkey
6873

6974
echo "credentials += Credentials(Path.userHome / \".sbt\" / \"credentials\")" > local.sbt
70-
echo "ThisBuild / version := \"$SBT_VER\"" >> local.sbt
75+
echo "ThisBuild / version := \"$BUILD_VER\"" >> local.sbt
7176

72-
mkdir -p $HOME/.sbt/
73-
echo "host = central.sonatype.com" > $HOME/.sbt/credentials
74-
echo "user = $SONATYPE_USER" >> $HOME/.sbt/credentials
75-
echo "password = $SONATYPE_PASS" >> $HOME/.sbt/credentials
77+
setupSonatype
7678

7779
sbt --server $RELEASE_COMMAND
7880

7981
rm -f $HOME/.sbt/credentials
82+
}
83+
84+
85+
releaseSonatype() {
86+
pushd sbt
87+
export BUILD_VER="$SBT_VER"
88+
releaseSonatypeCommon
8089
popd
8190
}
8291

8392
releaseSonatypeZinc() {
8493
pushd zinc
94+
export BUILD_VER="$ZINC_VER"
95+
releaseSonatypeCommon
96+
popd
97+
}
8598

86-
installGpgkey
87-
88-
echo "credentials += Credentials(Path.userHome / \".sbt\" / \"credentials\")" > local.sbt
89-
echo "ThisBuild / version := \"$ZINC_VER\"" >> local.sbt
90-
91-
mkdir -p $HOME/.sbt/
92-
echo "host = central.sonatype.com" > $HOME/.sbt/credentials
93-
echo "user = $SONATYPE_USER" >> $HOME/.sbt/credentials
94-
echo "password = $SONATYPE_PASS" >> $HOME/.sbt/credentials
95-
96-
sbt --server $RELEASE_COMMAND
97-
98-
rm -f $HOME/.sbt/credentials
99+
releaseSonatypeIo() {
100+
pushd io
101+
export BUILD_VER="$IO_VER"
102+
releaseSonatypeCommon
99103
popd
100104
}
101105

@@ -120,6 +124,10 @@ case ${mode:-} in
120124
echo Sonatype Zinc release
121125
releaseSonatypeZinc
122126
;;
127+
sonatype_io)
128+
echo Sonatype IO release
129+
releaseSonatypeIo
130+
;;
123131
*)
124132
echo no mode is set
125133
;;

0 commit comments

Comments
 (0)