1
- name : Verify and Release on tags
1
+ name : Verify and Release
2
2
3
3
# trigger on push to branches and PR
4
4
on :
11
11
- ' v[0-9]+.[0-9]+.[0-9]+'
12
12
pull_request :
13
13
14
+ env :
15
+ # restore to default url to download maven
16
+ MVNW_REPOURL : https://repo.maven.apache.org/maven2
17
+
14
18
jobs :
15
19
lint_shellcheck :
16
20
name : shellcheck
49
53
distribution : ' temurin'
50
54
cache : maven
51
55
- name : Lint Maven Pom Format
52
- run : ./mvnw -V -B -ntp sortpom:verify -Dsort.verifyFail=STOP
56
+ run : ./mvnw -V -B -ntp -Dmirror.of.proxy= sortpom:verify -Dsort.verifyFail=STOP
53
57
- name : Lint Check Maven Plugins
54
- run : ./mvnw -B -ntp artifact:check-buildplan
58
+ run : ./mvnw -B -ntp -Dmirror.of.proxy= artifact:check-buildplan
55
59
56
60
verify :
57
61
name : ' Verify with JDK ${{ matrix.jdk }}'
@@ -73,21 +77,33 @@ jobs:
73
77
cache : maven
74
78
75
79
- name : Maven verify
76
- if : ${{ ! startsWith(github.ref, 'refs/tags/v') }}
77
- run : ./mvnw -B -ntp -e verify
80
+ run : ./mvnw -B -ntp -e -Dmirror.of.proxy= verify
78
81
79
- - name : Maven verify and check reproducible on tags
80
- if : startsWith(github.ref, 'refs/tags/v')
82
+ reproducible :
83
+ name : ' Build and check reproducible'
84
+ runs-on : ubuntu-latest
85
+ if : startsWith(github.ref, 'refs/tags/v')
86
+ needs : [ verify ]
87
+ steps :
88
+ - uses : actions/checkout@v4
89
+ - name : Set up JDK
90
+ uses : actions/setup-java@v4
91
+ with :
92
+ java-version : 11
93
+ distribution : ' temurin'
94
+ cache : maven
95
+
96
+ - name : Build reproducible artifacts
81
97
shell : bash
82
98
run : |
83
99
set -ux
84
- ./mvnw -B -ntp -e install -Dbuildinfo.detect.skip=false
85
- ./mvnw -B -ntp -e clean
100
+ ./mvnw -B -ntp -e -Dmirror.of.proxy= install -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false
101
+ ./mvnw -B -ntp -e -Dmirror.of.proxy= clean
86
102
mkdir -p target
87
103
88
104
true artifact:compare should not contain warning or error
89
105
trap 'cat target/build.log' ERR
90
- ./mvnw -B -ntp -e -l target/build.log package artifact:compare -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false
106
+ ./mvnw -B -ntp -e -Dmirror.of.proxy= - l target/build.log package artifact:compare -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false
91
107
92
108
test 0 = "$(sed -n '/^\\[INFO\\] --- maven-artifact-plugin:[^:][^:]*:compare/,/^\\[INFO\\] ---/ p' target/build.log | grep -c '^\\[\\(WARNING\\|ERROR\\)\\]')"
93
109
@@ -97,3 +113,31 @@ jobs:
97
113
trap '' ERR
98
114
99
115
find . -name "*.buildcompare" -print0 | xargs -0 cat
116
+
117
+ - name : Store artifacts
118
+ uses : actions/upload-artifact@v4
119
+ with :
120
+ path : core/target/hbox-*-dist.tar.gz
121
+ retention-days : 7
122
+
123
+ create_a_draft_release :
124
+ name : Create a draft release
125
+ runs-on : ubuntu-latest
126
+ if : github.repository == 'Qihoo360/hbox' && startsWith(github.ref, 'refs/tags/v')
127
+ needs : [ reproducible ]
128
+ permissions :
129
+ contents : write
130
+ steps :
131
+ - name : Download artifacts
132
+ uses : actions/download-artifact@v4
133
+ with :
134
+ merge-multiple : true
135
+ path : core/target/
136
+
137
+ - name : Publish artifacts
138
+ uses : softprops/action-gh-release@v2
139
+ with :
140
+ draft : true
141
+ prerelease : ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
142
+ fail_on_unmatched_files : true
143
+ files : core/target/hbox-*-dist.tar.gz
0 commit comments