File tree 7 files changed +97
-23
lines changed
aws-lambda-java-runtime-interface-client
7 files changed +97
-23
lines changed Original file line number Diff line number Diff line change 62
62
name : the-jar
63
63
path : ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-*.jar
64
64
65
+ publish :
66
+ needs : build
67
+ if : github.ref == 'refs/heads/main'
68
+
69
+ permissions :
70
+ id-token : write
71
+ contents : read
72
+
73
+ steps :
74
+ - name : Issue AWS credentials
75
+ uses : aws-actions/configure-aws-credentials@v1
76
+ with :
77
+ aws-region : ${{ secrets.AWS_REGION }}
78
+ role-to-assume : ${{ secrets.AWS_ROLE }}
79
+ role-session-name : GitHubActionsPublishPackage
80
+ role-duration-seconds : 900
81
+
82
+ - name : Prepare codeartifact properties
83
+ working-directory : ./aws-lambda-java-runtime-interface-client/ric-dev-environment
84
+ run : |
85
+ cat <<EOF > codeartifact-properties.mk
86
+ CODE_ARTIFACT_REPO_ACCOUNT=${{ secrets.AWS_ACCOUNT }}
87
+ CODE_ARTIFACT_REPO_REGION=${{ env.AWS_REGION }}
88
+ CODE_ARTIFACT_REPO_NAME=${{ secrets.CODE_ARTIFACT_REPO_NAME }}
89
+ CODE_ARTIFACT_DOMAIN=${{ secrets.AWS_CODEARTIFACT_DOMAIN }}
90
+ EOF
91
+
92
+ - name : Publish
93
+ working-directory : ./aws-lambda-java-runtime-interface-client
94
+ env :
95
+ ENABLE_SNAPSHOT : ${{ secrets.ENABLE_SNAPSHOT }}
96
+ run : make publish
Original file line number Diff line number Diff line change 1
1
compile-flags.txt
2
- ric-dev-environment /dev-maven-repo .mk
2
+ ric-dev-environment /codeartifact-properties .mk
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ ARCHITECTURE_ALIAS := $($(shell echo "$(ARCHITECTURE)_ALIAS"))
5
5
ARCHITECTURE_ALIAS := $(or $(ARCHITECTURE_ALIAS ) ,amd64) # on any other archs defaulting to amd64
6
6
7
7
# This optional module exports MAVEN_REPO_URL, MAVEN_REPO_USERNAME and MAVEN_REPO_PASSWORD environment variables
8
- # making it possible to publish resulting artifacts to a development maven repository
9
- -include ric-dev-environment/dev-maven -repo.mk
8
+ # making it possible to publish resulting artifacts to a codeartifact maven repository
9
+ -include ric-dev-environment/codeartifact -repo.mk
10
10
11
11
.PHONY : target
12
12
target :
48
48
49
49
.PHONY : publish
50
50
publish :
51
- mvn deploy --settings ric-dev-environment/settings.xml
51
+ ./ ric-dev-environment/publish_snapshot.sh
52
52
53
53
define HELP_MESSAGE
54
54
Original file line number Diff line number Diff line change 184
184
<profiles >
185
185
<profile >
186
186
<id >dev</id >
187
- <activation >
188
- <file >
189
- <exists >ric-dev-environment/dev-maven-repo.mk</exists >
190
- </file >
191
- </activation >
192
- <distributionManagement >
193
- <snapshotRepository >
194
- <id >dev-snapshot-repo</id >
195
- <url >${env.MAVEN_REPO_URL} </url >
196
- </snapshotRepository >
197
- </distributionManagement >
198
187
<build >
199
188
<plugins >
200
189
<plugin >
277
266
</plugins >
278
267
</build >
279
268
</profile >
269
+ <profile >
270
+ <id >ci-repo</id >
271
+ <distributionManagement >
272
+ <repository >
273
+ <id >ci-repo</id >
274
+ <url >${env.MAVEN_REPO_URL} </url >
275
+ </repository >
276
+ </distributionManagement >
277
+ </profile >
280
278
</profiles >
281
279
</project >
Original file line number Diff line number Diff line change
1
+
2
+ ifneq ("$(wildcard ric-dev-environment/codeartifact-properties.mk) ","")
3
+
4
+ include ric-dev-environment/codeartifact-properties.mk
5
+ $(info Found codeartifact-properties.mk module)
6
+
7
+ export MAVEN_REPO_URL: =$(shell aws codeartifact get-repository-endpoint \
8
+ --domain ${CODE_ARTIFACT_DOMAIN} \
9
+ --repository ${CODE_ARTIFACT_REPO_NAME} \
10
+ --format maven \
11
+ --output text \
12
+ --region ${CODE_ARTIFACT_REPO_REGION})
13
+
14
+ export MAVEN_REPO_PASSWORD: =$(shell aws codeartifact get-authorization-token \
15
+ --domain ${CODE_ARTIFACT_DOMAIN} \
16
+ --domain-owner ${CODE_ARTIFACT_REPO_ACCOUNT} \
17
+ --query authorizationToken \
18
+ --output text \
19
+ --region ${CODE_ARTIFACT_REPO_REGION})
20
+
21
+ export MAVEN_REPO_USERNAME: =aws
22
+
23
+ $(info MAVEN_REPO_URL : $(MAVEN_REPO_URL ) )
24
+ # $(info MAVEN_REPO_PASSWORD: $(MAVEN_REPO_PASSWORD))
25
+ $(info MAVEN_REPO_USERNAME : $(MAVEN_REPO_USERNAME ) )
26
+ $(info CODE_ARTIFACT_REPO_NAME : $(CODE_ARTIFACT_REPO_NAME ) )
27
+ endif
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ projectVersion=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
6
+ if [[ -z ${ENABLE_SNAPSHOT} ]]; then
7
+ echo " Skipping SNAPSHOT deployment, as ENABLE_SNAPSHOT environment variable is not defined"
8
+ exit
9
+ fi
10
+
11
+ echo " Deploying SNAPSHOT artifact"
12
+ if [[ ${projectVersion} != * " SNAPSHOT" * ]]; then
13
+ snapshotProjectVersion=" ${projectVersion} -SNAPSHOT"
14
+ echo " projectVersion: ${projectVersion} "
15
+ echo " snapshotProjectVersion: ${snapshotProjectVersion} "
16
+ mvn versions:set " -DnewVersion=${snapshotProjectVersion} "
17
+ else
18
+ echo " Already -SNAPSHOT version"
19
+ fi
20
+
21
+ mvn -P ci-repo deploy --settings ric-dev-environment/settings.xml
22
+ mv pom.xml.versionsBackup pom.xml
Original file line number Diff line number Diff line change 1
1
<settings >
2
2
<profiles >
3
3
<profile >
4
- <id >dev</id >
5
- <activation >
6
- <file >
7
- <exists >dev-maven-repo.mk</exists >
8
- </file >
9
- </activation >
4
+ <id >dev-ci</id >
10
5
<repositories >
11
6
<repository >
12
- <id >dev-snapshot -repo</id >
7
+ <id >ci -repo</id >
13
8
<url >${env.MAVEN_REPO_URL}</url >
14
9
</repository >
15
10
</repositories >
16
11
</profile >
17
12
</profiles >
18
13
<servers >
19
14
<server >
20
- <id >dev-snapshot -repo</id >
15
+ <id >ci -repo</id >
21
16
<username >${env.MAVEN_REPO_USERNAME}</username >
22
17
<password >${env.MAVEN_REPO_PASSWORD}</password >
23
18
</server >
You can’t perform that action at this time.
0 commit comments