Skip to content

Commit d8f36e9

Browse files
committed
GH-331 - Switch to ZIP files for all artifacts.
Also, let these zip files be generated by the Maven Assembly plugin.
1 parent ce8ec05 commit d8f36e9

5 files changed

Lines changed: 35 additions & 56 deletions

File tree

.github/workflows/binary-release.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,16 @@ jobs:
7171
native-image-job-reports: 'true'
7272
cache: 'maven'
7373

74-
- name: Build Native Binary
74+
- name: Set Maven Version
75+
run: ./mvnw -B versions:set -DnewVersion="${{ github.event.inputs.version || github.ref_name }}" -DgenerateBackupPoms=false
76+
77+
- name: Build and Install Project
78+
run: ./mvnw -B clean install -DskipTests
79+
80+
- name: Build Distribution
7581
working-directory: jmolecules-cli
7682
run: ../mvnw -B -Pdist clean package
7783

78-
- name: Create Archive (Unix)
79-
if: matrix.platform != 'windows'
80-
working-directory: jmolecules-cli/target
81-
run: |
82-
mkdir -p distributions bin completion
83-
cp jm bin/
84-
cp jm.completion completion/
85-
tar -czf distributions/jm-${{ github.event.inputs.version || github.ref_name }}-${{ matrix.artifact-suffix }}.tar.gz bin/jm completion/jm.completion
86-
87-
- name: Create Archive (Windows)
88-
if: matrix.platform == 'windows'
89-
working-directory: jmolecules-cli/target
90-
shell: pwsh
91-
run: |
92-
New-Item -ItemType Directory -Force -Path distributions
93-
New-Item -ItemType Directory -Force -Path bin
94-
New-Item -ItemType Directory -Force -Path completion
95-
Copy-Item jm.exe -Destination bin/
96-
Copy-Item jm.completion -Destination completion/
97-
Compress-Archive -Path bin/jm.exe,completion/jm.completion -DestinationPath distributions/jm-${{ github.event.inputs.version || github.ref_name }}-${{ matrix.artifact-suffix }}.zip
98-
9984
- name: Upload Artifact
10085
uses: actions/upload-artifact@v4
10186
with:

jmolecules-cli/jreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ distributions:
4040
name: jm
4141
windowsExtension: exe
4242
artifacts:
43-
- path: target/distributions/{{distributionName}}-{{projectVersion}}-osx-x86_64.tar.gz
43+
- path: target/distributions/{{distributionName}}-{{projectVersion}}-osx-x86_64.zip
4444
platform: osx-x86_64
45-
- path: target/distributions/{{distributionName}}-{{projectVersion}}-osx-aarch64.tar.gz
45+
- path: target/distributions/{{distributionName}}-{{projectVersion}}-osx-aarch_64.zip
4646
platform: osx-aarch_64
47-
- path: target/distributions/{{distributionName}}-{{projectVersion}}-linux-x86_64.tar.gz
47+
- path: target/distributions/{{distributionName}}-{{projectVersion}}-linux-x86_64.zip
4848
platform: linux-x86_64
4949
- path: target/distributions/{{distributionName}}-{{projectVersion}}-windows-x86_64.zip
5050
platform: windows-x86_64

jmolecules-cli/pom.xml

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -121,33 +121,6 @@
121121
</executions>
122122
</plugin>
123123

124-
<plugin>
125-
<groupId>kr.motd.maven</groupId>
126-
<artifactId>os-maven-plugin</artifactId>
127-
<version>1.7.1</version>
128-
<executions>
129-
<execution>
130-
<goals>
131-
<goal>detect</goal>
132-
</goals>
133-
</execution>
134-
</executions>
135-
</plugin>
136-
137-
<plugin>
138-
<groupId>org.apache.maven.plugins</groupId>
139-
<artifactId>maven-assembly-plugin</artifactId>
140-
<version>3.7.1</version>
141-
<configuration>
142-
<attach>false</attach>
143-
<appendAssemblyId>false</appendAssemblyId>
144-
<outputDirectory>${project.build.directory}/distributions</outputDirectory>
145-
<descriptors>
146-
<descriptor>src/main/assembly/assembly.xml</descriptor>
147-
</descriptors>
148-
</configuration>
149-
</plugin>
150-
151124
</plugins>
152125
</build>
153126

@@ -156,6 +129,18 @@
156129
<id>dist</id>
157130
<build>
158131
<plugins>
132+
<plugin>
133+
<groupId>kr.motd.maven</groupId>
134+
<artifactId>os-maven-plugin</artifactId>
135+
<version>1.7.1</version>
136+
<executions>
137+
<execution>
138+
<goals>
139+
<goal>detect</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
159144
<plugin>
160145
<groupId>org.graalvm.buildtools</groupId>
161146
<artifactId>native-maven-plugin</artifactId>
@@ -172,6 +157,16 @@
172157
<plugin>
173158
<groupId>org.apache.maven.plugins</groupId>
174159
<artifactId>maven-assembly-plugin</artifactId>
160+
<version>3.7.1</version>
161+
<configuration>
162+
<attach>false</attach>
163+
<appendAssemblyId>false</appendAssemblyId>
164+
<finalName>jm-${project.version}-${os.detected.classifier}</finalName>
165+
<outputDirectory>${project.build.directory}/distributions</outputDirectory>
166+
<descriptors>
167+
<descriptor>src/main/assembly/assembly.xml</descriptor>
168+
</descriptors>
169+
</configuration>
175170
<executions>
176171
<execution>
177172
<id>assemble-distribution</id>
@@ -186,4 +181,4 @@
186181
</build>
187182
</profile>
188183
</profiles>
189-
</project>
184+
</project>

jmolecules-cli/src/jreleaser/distributions/jm/brew/formula.rb.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ class {{brewFormulaName}} < Formula
1616
{{/brewDependencies}}
1717

1818
on_intel do
19-
url "{{distributionUrl}}", using: :nounzip
19+
url "{{distributionUrl}}"
2020
sha256 "{{distributionChecksumSha256}}"
2121
end
2222

2323
on_arm do
24-
url "{{distributionUrlArm}}", using: :nounzip
24+
url "{{distributionUrlArm}}"
2525
sha256 "{{distributionChecksumSha256Arm}}"
2626
end
2727

jmolecules-cli/src/main/assembly/assembly.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<id>distribution</id>
66
<formats>
77
<format>zip</format>
8-
<format>tar.gz</format>
98
</formats>
109
<includeBaseDirectory>false</includeBaseDirectory>
1110
<fileSets>

0 commit comments

Comments
 (0)