forked from apache/causeway
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (93 loc) · 3.15 KB
/
ci-build-artifacts-push-maven.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
98
99
100
101
102
103
104
105
106
107
108
109
name: Apache Causeway Weekly Build
on:
workflow_dispatch:
schedule:
# daily 02:00 (UTC) on Sunday morning
- cron: '0 2 * * 0'
jobs:
build:
name: build-local-push
runs-on: ubuntu-latest
env:
# to be shared among all steps of this job
PROJECT_ROOT_PATH: ${{ github.workspace }}
CI_SCRIPTS_PATH: ${{ github.workspace }}/scripts/ci
# not used, would be nice if we could transform the TIMESTAMP string into the REVISION
# variable here, but it seems github not yet has any string expression manipulation
# operators other than concatenation
TIMESTAMP: ${{ github.event.head_commit.timestamp }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Find baseline from search.maven.org
id: calc-baseline
run: 'bash scripts/ci/calc-baseline.sh'
- name: Share $BASELINE as Environment Variable
run: echo "BASELINE=${{ steps.calc-baseline.outputs.baseline }}" >> $GITHUB_ENV
- name: Calculate new $REVISION
id: revision
run: 'bash scripts/ci/calc-revision.sh'
- name: Share $REVISION as Environment Variable
run: echo "REVISION=${{ steps.revision.outputs.revision }}" >> $GITHUB_ENV
- name: Dump Env context
env:
ENV_CONTEXT: ${{ toJson(env) }}
run: 'echo "$ENV_CONTEXT"'
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Activate Cache for Maven Downloads
uses: actions/cache@v3
env:
# change the cache-name if we want to rebuild the cache
# can be reset via github action page
cache-name: maven-shared
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}
${{ runner.os }}-
# - name: Create GitHub Release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.REVISION }}
# release_name: Release ${{ env.REVISION }}
- name: Build Artifacts (Github March 2022)
run: 'bash scripts/ci/build-artifacts.sh'
env:
# -Dgithub ... build only the released modules and deploy to github packages
MVN_ADDITIONAL_OPTS: >-
-f bom/pom.xml
-Dgithub
GITHUB_TOKEN: ${{ github.token }}
MVN_STAGES: deploy
SOURCE_MODE: attach
# FOR DEBUG USE
# - name: Dump job context
# env:
# JOB_CONTEXT: ${{ toJson(job) }}
# run: echo "$JOB_CONTEXT"
# - name: Dump steps context
# env:
# STEPS_CONTEXT: ${{ toJson(steps) }}
# run: echo "$STEPS_CONTEXT"
# - name: Dump runner context
# env:
# RUNNER_CONTEXT: ${{ toJson(runner) }}
# run: echo "$RUNNER_CONTEXT"
# - name: Dump strategy context
# env:
# STRATEGY_CONTEXT: ${{ toJson(strategy) }}
# run: echo "$STRATEGY_CONTEXT"
# - name: Dump matrix context
# env:
# MATRIX_CONTEXT: ${{ toJson(matrix) }}
# run: echo "$MATRIX_CONTEXT"