Skip to content

Commit a947b4d

Browse files
ci: setup to deploy to Github packages
1 parent 6245b6f commit a947b4d

File tree

4 files changed

+35
-197
lines changed

4 files changed

+35
-197
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['**', '!update/**', '!pr/**']
12+
branches: [ '**', '!update/**', '!pr/**' ]
1313
push:
14-
branches: ['**', '!update/**', '!pr/**']
15-
tags: [v*]
14+
branches: [ '**', '!update/**', '!pr/**' ]
15+
tags: [ v* ]
1616

1717
env:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
1919

2020

2121
concurrency:
@@ -27,9 +27,9 @@ jobs:
2727
name: Test
2828
strategy:
2929
matrix:
30-
os: [ubuntu-latest]
31-
scala: [3]
32-
java: [graalvm@21]
30+
os: [ ubuntu-latest ]
31+
scala: [ 3 ]
32+
java: [ graalvm@21 ]
3333
runs-on: ${{ matrix.os }}
3434
timeout-minutes: 60
3535
steps:
@@ -89,12 +89,12 @@ jobs:
8989

9090
publish:
9191
name: Publish Artifacts
92-
needs: [prepare-release]
92+
needs: [ prepare-release ]
9393
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
9494
strategy:
9595
matrix:
96-
os: [ubuntu-latest]
97-
java: [graalvm@21]
96+
os: [ ubuntu-latest ]
97+
java: [ graalvm@21 ]
9898
runs-on: ${{ matrix.os }}
9999
steps:
100100
- name: Checkout current branch (full)
@@ -128,37 +128,23 @@ jobs:
128128
tar xf targets.tar
129129
rm targets.tar
130130
131-
- name: Import signing key
132-
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
133-
env:
134-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
135-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
136-
run: echo $PGP_SECRET | base64 -d -i - | gpg --import
137-
138-
- name: Import signing key and strip passphrase
139-
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
140-
env:
141-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
142-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
143-
run: |
144-
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
145-
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
146-
(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)
131+
- name: Login to Github registry
132+
uses: docker/login-action@v3
133+
with:
134+
registry: ghcr.io
135+
username: ${{ secrets.CI_BOT_USERNAME }}
136+
password: ${{ secrets.CI_BOT_TOKEN }}
147137

148138
- name: Publish
149-
env:
150-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
151-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
152-
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
153-
run: sbt tlCiRelease
139+
run: sbt publish
154140

155141
dependency-submission:
156142
name: Submit Dependencies
157143
if: github.event.repository.fork == false && github.event_name != 'pull_request'
158144
strategy:
159145
matrix:
160-
os: [ubuntu-22.04]
161-
java: [graalvm@21]
146+
os: [ ubuntu-22.04 ]
147+
java: [ graalvm@21 ]
162148
runs-on: ${{ matrix.os }}
163149
steps:
164150
- name: Checkout current branch (full)
@@ -192,8 +178,8 @@ jobs:
192178
name: Validate Steward Config
193179
strategy:
194180
matrix:
195-
os: [ubuntu-22.04]
196-
java: [temurin@11]
181+
os: [ ubuntu-22.04 ]
182+
java: [ temurin@11 ]
197183
runs-on: ${{ matrix.os }}
198184
steps:
199185
- name: Checkout current branch (fast)
@@ -215,13 +201,13 @@ jobs:
215201

216202
prepare-release:
217203
name: 👷 Prepare release
218-
needs: [build]
204+
needs: [ build ]
219205
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/main'))
220206
strategy:
221207
matrix:
222-
os: [ubuntu-latest]
223-
scala: [2.13]
224-
java: [temurin@11]
208+
os: [ ubuntu-latest ]
209+
scala: [ 2.13 ]
210+
java: [ temurin@11 ]
225211
runs-on: ${{ matrix.os }}
226212
permissions:
227213
actions: write
@@ -294,86 +280,3 @@ jobs:
294280
makeLatest: true
295281
allowUpdates: true
296282
token: ${{ github.token }}
297-
298-
website:
299-
name: 🌐 Publish website
300-
needs: [publish]
301-
strategy:
302-
matrix:
303-
os: [ubuntu-latest]
304-
scala: [2.13]
305-
java: [temurin@11]
306-
runs-on: ${{ matrix.os }}
307-
permissions:
308-
actions: write
309-
checks: write
310-
contents: write
311-
deployments: write
312-
id-token: none
313-
issues: write
314-
packages: write
315-
pages: write
316-
pull-requests: write
317-
repository-projects: write
318-
security-events: write
319-
statuses: write
320-
env:
321-
DTC_HEADLESS: true
322-
steps:
323-
- name: Checkout current branch (fast)
324-
uses: actions/checkout@v4
325-
326-
- name: Setup
327-
run: chmod +x dtcw
328-
329-
- name: Setup Java (temurin@17)
330-
id: setup-java-temurin-17
331-
if: matrix.java == 'temurin@17'
332-
uses: actions/setup-java@v4
333-
with:
334-
distribution: temurin
335-
java-version: 17
336-
cache: sbt
337-
338-
- name: sbt update
339-
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
340-
run: sbt +update
341-
342-
- name: Setup sbt
343-
uses: sbt/setup-sbt@v1
344-
345-
- name: Install docToolchain
346-
run: ./dtcw local install doctoolchain
347-
348-
- name: Cache sbt
349-
uses: actions/cache@v4
350-
with:
351-
path: |
352-
.ivy2
353-
.sbt
354-
key: sbt-${{ hashFiles('build.sbt', 'plugins.sbt') }}
355-
restore-keys: pillars-cache-${{ hashFiles('build.sbt', 'plugins.sbt') }}
356-
357-
- name: Get latest version
358-
id: version
359-
run: |
360-
PILLARS_VERSION="$(git ls-remote --tags $REPO | awk -F"/" '{print $3}' | grep '^v[0-9]*\.[0-9]*\.[0-9]*' | grep -v '\{\}' | sort --version-sort | tail -n1)"
361-
echo "latest version is [$PILLARS_VERSION]"
362-
echo "version=${PILLARS_VERSION#v}" >> "$GITHUB_OUTPUT"
363-
364-
- name: Generate site
365-
env:
366-
PILLARS_VERSION: ${{ steps.version.outputs.version }}
367-
DTC_HEADLESS: true
368-
run: ./dtcw local generateSite && sbt unidoc
369-
370-
- name: Copy to public
371-
run: cp -r target/microsite/output ./public
372-
373-
- name: Deploy to GitHub Pages
374-
uses: peaceiris/actions-gh-pages@v4
375-
with:
376-
github_token: ${{ github.token }}
377-
publish_dir: ./public
378-
cname: pillars.dev
379-
enable_jekyll: false

.github/workflows/clean.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

build.sbt

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
import sbt.ThisBuild
2-
import xerial.sbt.Sonatype.GitHubHosting
3-
import xerial.sbt.Sonatype.sonatypeCentralHost
42

53
ThisBuild / tlBaseVersion := "0.5" // your current series x.y
64

7-
ThisBuild / organization := "io.funktional"
8-
ThisBuild / homepage := Some(url("https://pillars.dev"))
9-
ThisBuild / startYear := Some(2023)
10-
ThisBuild / licenses := Seq("EPL-2.0" -> url("https://www.eclipse.org/legal/epl-2.0/"))
5+
ThisBuild / resolvers += Resolver.githubPackages("LedgerHQ")
6+
ThisBuild / githubOwner := "LedgerHQ"
7+
ThisBuild / githubRepository := "pillars"
8+
ThisBuild / organization := "co.ledger"
9+
ThisBuild / homepage := Some(url("https://pillars.dev"))
10+
ThisBuild / startYear := Some(2023)
11+
ThisBuild / licenses := Seq("EPL-2.0" -> url("https://www.eclipse.org/legal/epl-2.0/"))
1112
ThisBuild / developers ++= List(
1213
// your GitHub handle and name
1314
tlGitHubDev("rlemaitre", "Raphaël Lemaitre")
1415
)
1516

16-
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
17-
ThisBuild / sonatypeProjectHosting := Some(GitHubHosting(
18-
"FunktionalIO",
19-
"pillars",
20-
21-
))
22-
ThisBuild / scmInfo := Some(
23-
ScmInfo(url("https://github.com/FunktionalIO/pillars"), "scm:git:[email protected]:FunktionalIO/pillars.git")
24-
)
25-
2617
ThisBuild / scalaVersion := versions.scala // the default Scala
2718

2819
ThisBuild / tlCiHeaderCheck := true

project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
77
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")
88
// Giter8 scaffold
99
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.17.0")
10+
11+
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
12+
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.1.0")

0 commit comments

Comments
 (0)