Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Add GitHub action #2

Merged
merged 42 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c9f929d
Added initial definition of action
okopanja Apr 3, 2022
f278e1d
Update pom.xml
okopanja Apr 3, 2022
1694181
Update build_zip_bundle.yml
okopanja Apr 3, 2022
b2cb24b
Update build_zip_bundle.yml
okopanja Apr 3, 2022
9c24ef4
Update pom.xml
okopanja Apr 3, 2022
3f6cdb8
Update pom.xml
okopanja Apr 3, 2022
297eb64
Update pom.xml
okopanja Apr 3, 2022
4bb90a9
Update build_zip_bundle.yml
okopanja Apr 4, 2022
3519812
Update build_zip_bundle.yml
okopanja Apr 4, 2022
7ba923c
Update build_zip_bundle.yml
okopanja Apr 4, 2022
791592a
Update build_zip_bundle.yml
okopanja Apr 4, 2022
8c91831
Update build_zip_bundle.yml
okopanja Apr 4, 2022
b2615ac
Update build_zip_bundle.yml
okopanja Apr 4, 2022
1fe3311
Update build_zip_bundle.yml
okopanja Apr 4, 2022
c88e188
Update build_zip_bundle.yml
okopanja Apr 4, 2022
3c18d17
Update build_zip_bundle.yml
okopanja Apr 4, 2022
288caa4
Update build_zip_bundle.yml
okopanja Apr 4, 2022
6096cfd
Update pom.xml
okopanja Apr 4, 2022
34b7c83
Update build_zip_bundle.yml
okopanja Apr 4, 2022
b74c6f4
Update pom.xml
okopanja Apr 4, 2022
df92d4d
Update build_zip_bundle.yml
okopanja Apr 4, 2022
308229f
Update build_zip_bundle.yml
okopanja Apr 4, 2022
5278412
Update pom.xml
okopanja Apr 4, 2022
d0da9a6
Update build_zip_bundle.yml
okopanja Apr 4, 2022
d9782c7
Update build_zip_bundle.yml
okopanja Apr 4, 2022
91739df
Update pom.xml
okopanja Apr 4, 2022
f784c9d
Update build_zip_bundle.yml
okopanja Apr 4, 2022
2041d4e
Update pom.xml
okopanja Apr 4, 2022
bd98e02
Update build_zip_bundle.yml
okopanja Apr 4, 2022
22c136d
Update build_zip_bundle.yml
okopanja Apr 4, 2022
280b678
Update build_zip_bundle.yml
okopanja Apr 4, 2022
159c1a7
Update build_zip_bundle.yml
okopanja Apr 4, 2022
257e779
Update build_zip_bundle.yml
okopanja Apr 4, 2022
504ef4d
Update build_zip_bundle.yml
okopanja Apr 4, 2022
ef87972
Update build_zip_bundle.yml
okopanja Apr 4, 2022
918922f
Update pom.xml
okopanja Apr 4, 2022
20a1f58
Update pom.xml
okopanja Apr 4, 2022
ceae98f
Corrected indent
okopanja Apr 4, 2022
c421279
Cleanup
okopanja Apr 4, 2022
b57c488
Update build_zip_bundle.yml
okopanja Apr 4, 2022
fe03f82
Update build_zip_bundle.yml
okopanja Apr 4, 2022
74e7912
Update build_zip_bundle.yml
okopanja Apr 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build_zip_bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: TheWay -> comile, test, package, create realase(on tag)
on: push
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Prepare versions for EXE file
uses: actions/github-script@v6
id: set_version
with:
script: |
const tag = context.ref.substring(10)
const no_v = tag.replace(/[^\d.-]/g, '')
const dash_index = no_v.lastIndexOf('-')
const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v
var file_version = no_dash
components = no_dash.split('.')
console.log(no_dash)
for (let i = 0; i < (4 - components.length); i++) {
file_version = file_version + '.0'
}
console.log(file_version)
core.setOutput('tag', tag)
core.setOutput('tag-no-v', no_v)
core.setOutput('tag-no-dash', no_dash)
core.setOutput('file-version', file_version)
if: startsWith(github.ref, 'refs/tags/')
- name: Maven -> set version based on tag
run: mvn --batch-mode versions:set -DnewVersion="${{ steps.set_version.outputs.tag-no-dash }}"
if: startsWith(github.ref, 'refs/tags/')
- name: Maven -> compile and test
run: mvn --batch-mode compile test
- name: Maven -> package
run: mvn --batch-mode package -Dfile_version="${{ steps.set_version.outputs.file-version }}" -Dtag_version="${{ steps.set_version.outputs.tag }}" -Drelease_url="${{ github.server_url }}/${{github.repository}}/releases/tag/${{ github.ref_name }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Create release and upload asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/dcstheway-${{ steps.set_version.outputs.tag-no-dash }}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
54 changes: 28 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>DCSTheWay</artifactId>
<version>1.0.0.0</version>
<artifactId>dcstheway</artifactId>
<version>1.0.0</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -41,13 +41,15 @@
</resources>
<plugins>
<!-- For bundling of exe we need to get rid of -SNAPSHOT from version -->
<!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<configuration>
<removeSnapshot>true</removeSnapshot>
</configuration>
</plugin>
-->
<!-- create jar with dependencies bundled inside-->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -72,7 +74,7 @@
</execution>
</executions>
</plugin>
<!-- create exe from the -->
<!-- create exe from the bundled jar -->
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
Expand All @@ -98,12 +100,12 @@
</opts>
</jre>
<versionInfo>
<fileVersion>${project.version}</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>Tool for loading waypoints into DCS World</fileDescription>
<copyright>?</copyright>
<productVersion>${project.version}</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<fileVersion>${file_version}</fileVersion>
<txtFileVersion>${tag_version}</txtFileVersion>
<fileDescription>${release_url}</fileDescription>
<copyright>GPLv3</copyright>
<productVersion>${file_version}</productVersion>
<txtProductVersion>${tag_version}</txtProductVersion>
<productName>DCS The Way</productName>
<internalName>DCS The Way</internalName>
<originalFilename>TheWay.exe</originalFilename>
Expand All @@ -112,21 +114,21 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals><goal>single</goal></goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals><goal>single</goal></goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</build>
</project>