1515 tags : [v*]
1616
1717env :
18- PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
19- SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
20- SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
21- SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
22- PGP_SECRET : ${{ secrets.PGP_SECRET }}
2318 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2419
20+
21+ concurrency :
22+ group : ${{ github.workflow }} @ ${{ github.ref }}
23+ cancel-in-progress : true
24+
2525jobs :
2626 build :
2727 name : Build and Test
2828 strategy :
2929 matrix :
3030 os : [ubuntu-latest]
31- scala : [2.12.18 ]
31+ scala : [2.12]
3232 java : [temurin@8]
3333 runs-on : ${{ matrix.os }}
34+ timeout-minutes : 60
3435 steps :
36+ - name : Install sbt
37+ if : contains(runner.os, 'macos')
38+ run : brew install sbt
39+
3540 - name : Checkout current branch (full)
36- uses : actions/checkout@v3
41+ uses : actions/checkout@v4
3742 with :
3843 fetch-depth : 0
3944
40- - name : Download Java (temurin@8)
41- id : download-java-temurin-8
42- if : matrix.java == 'temurin@8'
43- uses : typelevel/download-java@v2
44- with :
45- distribution : temurin
46- java-version : 8
47-
4845 - name : Setup Java (temurin@8)
46+ id : setup-java-temurin-8
4947 if : matrix.java == 'temurin@8'
50- uses : actions/setup-java@v3
48+ uses : actions/setup-java@v4
5149 with :
52- distribution : jdkfile
50+ distribution : temurin
5351 java-version : 8
54- jdkFile : ${{ steps.download-java-temurin-8.outputs.jdkFile }}
52+ cache : sbt
5553
56- - name : Cache sbt
57- uses : actions/cache@v3
58- with :
59- path : |
60- ~/.sbt
61- ~/.ivy2/cache
62- ~/.coursier/cache/v1
63- ~/.cache/coursier/v1
64- ~/AppData/Local/Coursier/Cache/v1
65- ~/Library/Caches/Coursier/v1
66- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
54+ - name : sbt update
55+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
56+ run : sbt +update
6757
6858 - name : Check that workflows are up to date
6959 run : sbt githubWorkflowCheck
@@ -85,15 +75,15 @@ jobs:
8575
8676 - name : Make target directories
8777 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
88- run : mkdir -p plugin/target scalafix/rules/target target/sbt-tpolecat-scalafix-aggregate/target scalafix/output/target scalafix/tests/target target scalafix/input/target project/target
78+ run : mkdir -p plugin/target scalafix/rules/target project/target
8979
9080 - name : Compress target directories
9181 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
92- run : tar cf targets.tar plugin/target scalafix/rules/target target/sbt-tpolecat-scalafix-aggregate/target scalafix/output/target scalafix/tests/target target scalafix/input/target project/target
82+ run : tar cf targets.tar plugin/target scalafix/rules/target project/target
9383
9484 - name : Upload target directories
9585 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
96- uses : actions/upload-artifact@v3
86+ uses : actions/upload-artifact@v4
9787 with :
9888 name : target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
9989 path : targets.tar
@@ -108,59 +98,95 @@ jobs:
10898 java : [temurin@8]
10999 runs-on : ${{ matrix.os }}
110100 steps :
101+ - name : Install sbt
102+ if : contains(runner.os, 'macos')
103+ run : brew install sbt
104+
111105 - name : Checkout current branch (full)
112- uses : actions/checkout@v3
106+ uses : actions/checkout@v4
113107 with :
114108 fetch-depth : 0
115109
116- - name : Download Java (temurin@8)
117- id : download -java-temurin-8
110+ - name : Setup Java (temurin@8)
111+ id : setup -java-temurin-8
118112 if : matrix.java == 'temurin@8'
119- uses : typelevel/download -java@v2
113+ uses : actions/setup -java@v4
120114 with :
121115 distribution : temurin
122116 java-version : 8
117+ cache : sbt
123118
124- - name : Setup Java (temurin@8)
125- if : matrix.java == 'temurin@8'
126- uses : actions/setup-java@v3
127- with :
128- distribution : jdkfile
129- java-version : 8
130- jdkFile : ${{ steps.download-java-temurin-8.outputs.jdkFile }}
119+ - name : sbt update
120+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
121+ run : sbt +update
131122
132- - name : Cache sbt
133- uses : actions/cache@v3
134- with :
135- path : |
136- ~/.sbt
137- ~/.ivy2/cache
138- ~/.coursier/cache/v1
139- ~/.cache/coursier/v1
140- ~/AppData/Local/Coursier/Cache/v1
141- ~/Library/Caches/Coursier/v1
142- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
143-
144- - name : Download target directories (2.12.18)
145- uses : actions/download-artifact@v3
123+ - name : Download target directories (2.12)
124+ uses : actions/download-artifact@v4
146125 with :
147- name : target-${{ matrix.os }}-${{ matrix.java }}-2.12.18
126+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12
148127
149- - name : Inflate target directories (2.12.18 )
128+ - name : Inflate target directories (2.12)
150129 run : |
151130 tar xf targets.tar
152131 rm targets.tar
153132
154133 - name : Import signing key
155134 if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
156- run : echo $PGP_SECRET | base64 -di | gpg --import
135+ env :
136+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
137+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
138+ run : echo $PGP_SECRET | base64 -d -i - | gpg --import
157139
158140 - name : Import signing key and strip passphrase
159141 if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
142+ env :
143+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
144+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
160145 run : |
161- echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
146+ echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
162147 echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
163148 (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
164149
165150 - name : Publish
151+ env :
152+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
153+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
154+ SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
166155 run : sbt tlCiRelease
156+
157+ dependency-submission :
158+ name : Submit Dependencies
159+ if : github.event_name != 'pull_request'
160+ strategy :
161+ matrix :
162+ os : [ubuntu-latest]
163+ java : [temurin@8]
164+ runs-on : ${{ matrix.os }}
165+ steps :
166+ - name : Install sbt
167+ if : contains(runner.os, 'macos')
168+ run : brew install sbt
169+
170+ - name : Checkout current branch (full)
171+ uses : actions/checkout@v4
172+ with :
173+ fetch-depth : 0
174+
175+ - name : Setup Java (temurin@8)
176+ id : setup-java-temurin-8
177+ if : matrix.java == 'temurin@8'
178+ uses : actions/setup-java@v4
179+ with :
180+ distribution : temurin
181+ java-version : 8
182+ cache : sbt
183+
184+ - name : sbt update
185+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
186+ run : sbt +update
187+
188+ - name : Submit Dependencies
189+ uses : scalacenter/sbt-dependency-submission@v2
190+ with :
191+ modules-ignore : sbt-tpolecat_2.12
192+ configs-ignore : test scala-tool scala-doc-tool test-internal
0 commit comments