-
Notifications
You must be signed in to change notification settings - Fork 8
112 lines (94 loc) · 4.08 KB
/
jakarta.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
110
111
112
name: Publish jakarta
on:
push:
branches:
- master
- pom-update
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Transform
env:
JAXRS_API: 2.1
JAXRS_SERVLET: 3.1.0
JAXRS_ANNOTATION: 1.3.1
JAXRS_XML: 2.3.1
JAKARTA_API: 3.1.0
JAKARTA_SERVLET: 6.0.0
JAKARTA_ANNOTATION: 2.1.1
JAKARTA_XML: 4.0.1
run: |
if ! grep -q "<javax.api.version>${JAXRS_API}" pom.xml; then
echo "Unable to find javax.api.version ${JAXRS_API}"
exit 1
fi
if ! grep -q "<javax.servlet.version>${JAXRS_SERVLET}" pom.xml; then
echo "Unable to find javax.servlet.version ${JAXRS_SERVLET}"
exit 1
fi
if ! grep -q "<javax.annotation.version>${JAXRS_ANNOTATION}" pom.xml; then
echo "Unable to find javax.annotation.version ${JAXRS_ANNOTATION}"
exit 1
fi
if ! grep -q "<javax.xml.version>${JAXRS_XML}" pom.xml; then
echo "Unable to find javax.xml.version ${JAXRS_XML}"
exit 1
fi
for f in $(find src -name '*.java'); do
sed -i -e 's/javax\./jakarta\./' $f;
sed -i -e 's/com\.authlete\.jaxrs/com\.authlete\.jakarta/' $f;
done
mv src/main/java/com/authlete/jaxrs src/main/java/com/authlete/jakarta
mv src/test/java/com/authlete/jaxrs src/test/java/com/authlete/jakarta
sed -i -e 's/javax\./jakarta\./' pom.xml;
sed -i -e 's/javax\./jakarta\./' pom.xml;
sed -i -e 's/jaxb-api/jakarta\.xml\.bind-api/' pom.xml;
sed -i -e 's/authlete-java-jaxrs/authlete-java-jakarta/' pom.xml;
sed -i -e "s/<jakarta\.api\.version>${JAXRS_API//./\\.}<\/jakarta\.api\.version>/<jakarta\.api\.version>${JAKARTA_API//./\\.}<\/jakarta\.api\.version>/" pom.xml;
sed -i -e "s/<jakarta\.servlet\.version>${JAXRS_SERVLET//./\\.}<\/jakarta\.servlet\.version>/<jakarta\.servlet\.version>${JAKARTA_SERVLET//./\\.}<\/jakarta\.servlet\.version>/" pom.xml;
sed -i -e "s/<jakarta\.annotation\.version>${JAXRS_ANNOTATION//./\\.}<\/jakarta\.annotation\.version>/<jakarta\.annotation\.version>${JAKARTA_ANNOTATION//./\\.}<\/jakarta\.annotation\.version>/" pom.xml;
sed -i -e "s/<jakarta\.xml\.version>${JAXRS_XML//./\\.}<\/jakarta\.xml\.version>/<jakarta\.xml\.version>${JAKARTA_XML//./\\.}<\/jakarta\.xml\.version>/" pom.xml;
- name: Setup git user
uses: fregante/setup-git-user@v1
- name: Push to jakarta repository
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
git clone https://AuthleteOPS:${ACCESS_TOKEN}@github.com/authlete/authlete-java-jakarta.git
git config --global user.email "[email protected]"
git config --global user.name "Authlete OPS"
cp -r src authlete-java-jakarta
cp pom.xml authlete-java-jakarta
cd authlete-java-jakarta
git add src
git add pom.xml
git commit -m "Jakarta $(date)"
git push
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test
run: |
echo "${{ secrets.ADMIN_AT_AUTHLETE_SEC }}" > ~/test.key
gpg --batch --import-options import-show --batch --passphrase "${{ secrets.ADMIN_AT_AUTHLETE_SEC_PASS }}" -d --import ~/test.key
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
# gpg-private-key: ${{ secrets.ADMIN_AT_AUTHLETE_SEC }}
# gpg-passphrase: ${{ secrets.ADMIN_AT_AUTHLETE_SEC_PASS }}
- name: Clone jakarta repository
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
git clone https://AuthleteOPS:${ACCESS_TOKEN}@github.com/authlete/authlete-java-jakarta.git
cd authlete-java-jakarta
- name: Prepare artifacts
run: mvn -P external release:prepare