@@ -8,55 +8,60 @@ concurrency:
88 group : ${{ github.workflow }} @ ${{ github.ref }}
99 cancel-in-progress : true
1010jobs :
11+ build :
12+ strategy :
13+ matrix :
14+ os : [ubuntu-latest, macos-15]
15+ runs-on : ${{ matrix.os }}
16+ steps :
17+ - uses : actions/checkout@v2
18+ - uses : coursier/cache-action@v6
19+ - uses : VirtusLab/scala-cli-setup@main
20+ with :
21+ jvm : temurin:21
22+ - name : Install libpq (macOS)
23+ if : runner.os == 'macOS'
24+ run : brew install libpq && brew link --force libpq
25+ - run : |
26+ OUT=out/skunk-codegen-$(uname -m)-$(uname | tr '[:upper:]' '[:lower:]')
27+ echo "Compiling to $OUT"
28+ scala-cli --power package \
29+ --native \
30+ --native-mode release-fast PgCodeGen.scala \
31+ -o $OUT -f && \
32+ zip -j "${OUT}.zip" $OUT
33+ - name : Upload command line binaries
34+ uses : actions/upload-artifact@v4
35+ with :
36+ name : codegen-bin-${{ matrix.os }}
37+ path : out/*
1138 test :
1239 runs-on : ubuntu-latest
1340 steps :
14- - name : Checkout
15- uses : actions/checkout@v4
16- - name : Setup JDK
17- uses : actions/setup-java@v4
18- with :
19- distribution : temurin
20- java-version : 21
21- cache : sbt
22- - name : Start up Postgres
23- run : docker run --rm -d -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:16-alpine
24- - name : Generate code
25- run : sbt '+core/Test/runMain com.anymindgroup.RunPgCodeGen'
26- - name : Test generated code
27- run : sbt '++2.13 Test/runMain com.anymindgroup.GeneratedCodeTest; ++3.3 Test/runMain com.anymindgroup.GeneratedCodeTest'
28- - name : Test sbt plugin
29- # for sbt < v2 which only supports scala 2.12
30- run : sbt ++2.12 scripted
31- release :
32- name : Release
33- runs-on : ubuntu-latest
34- continue-on-error : false
35- needs :
36- - test
37- if : ${{ startsWith(github.ref, 'refs/tags/v') }}
41+ - uses : actions/checkout@v2
42+ - uses : coursier/cache-action@v6
43+ - uses : VirtusLab/scala-cli-setup@main
44+ with :
45+ jvm : temurin:21
46+ - run : ./test.sh
47+
48+ publish-bin :
49+ name : Publish command line binaries
50+ needs : [build]
51+ if : startsWith(github.ref, 'refs/tags/')
52+ strategy :
53+ matrix :
54+ os : [ubuntu-latest]
55+ runs-on : ${{ matrix.os }}
3856 steps :
39- - name : Git Checkout
40- uses : actions/checkout@v4
41- - name : Setup JDK
42- uses : actions/setup-java@v4
43- with :
44- distribution : temurin
45- java-version : 21
46- cache : sbt
47- - name : Import signing key and strip passphrase
48- if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
49- env :
50- PGP_SECRET : ${{ secrets.PGP_SECRET }}
51- PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
52- run : |
53- echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
54- echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
55- (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)
56- - name : Release
57- run : sbt '++2.12 publishSigned; sonatypeCentralRelease'
58- env :
59- PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
60- PGP_SECRET : ${{ secrets.PGP_SECRET }}
61- SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
62- SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
57+ - name : Download command line binaries
58+ uses : actions/download-artifact@v4
59+ with :
60+ pattern : codegen-bin-*
61+ path : out
62+ merge-multiple : true
63+
64+ - name : Upload release binaries
65+ uses : softprops/action-gh-release@v1
66+ with :
67+ files : out/*
0 commit comments