-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (95 loc) · 2.94 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build
on:
workflow_dispatch:
inputs: {}
push:
branches: [ "develop" ]
tags: [ "v**" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
scala: [ '2.12', '2.13', '3.2' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
# - uses: actions/setup-go@v5
# with:
# go-version: '1.21.4' # The Go version to download (if necessary) and use.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
- name: Build and Test
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} coverage
- uses: codecov/codecov-action@v3
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
with:
token: ${{ secrets.TOKEN_CODECOV }} # not required for public repos but works unreliable without it
verbose: true # optional (default = false)
fail_ci_if_error: true
files: cobertura.xml
# TODO: do we need scoverage.xml? If so files: may be just omitted
# files: cobertura.xml,scoverage.xml
# flags: unittests
checksecret:
runs-on: ubuntu-latest
outputs:
HAVE_SECRETS: ${{ steps.checksecret_job.outputs.HAVE_SECRETS }}
steps:
- id: checksecret_job
env:
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
run: |
echo "HAVE_SECRETS=${{ env.OPENSSL_IV != '' && env.OPENSSL_KEY != '' }}" >> $GITHUB_OUTPUT
publish-alien:
runs-on: ubuntu-latest
needs: [ 'checksecret' ]
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
steps:
- uses: 7mind/github-env@main
with:
java-version: 11
- name: Publish alien artifacts
env:
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
TOKEN_NUGET: ${{ secrets.TOKEN_NUGET }}
TOKEN_NPM: ${{ secrets.TOKEN_NPM }}
run: |
bash .build.sh 2.12 secrets publishIDL
publish-artifacts:
runs-on: ubuntu-latest
needs: [ 'build', 'checksecret' ]
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
strategy:
matrix:
java: [ '11' ]
scala: [ '2.12', '2.13', '3.2' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- name: Build and Publish to Sonatype
env:
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} secrets publishScala
all-good:
if: always()
runs-on: ubuntu-latest
needs: [ 'build' ]
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}