Skip to content

Commit

Permalink
[Backport 2024.02.xx] Update upload-artifact and cache github action …
Browse files Browse the repository at this point in the history
…to most recent versions (#10790) (#10792)

* Update upload-artifact and cache github action to most recent versions (#10790)

* Update upload-artifact action

* Updated cache actions to v4

* Fixed set-output warning

* Addressing build issue by changing antrun task to target

---------

Co-authored-by: Tobia Di Pisa <tobia.dipisa@geosolutionsgroup.com>
  • Loading branch information
offtherailz and tdipisa authored Jan 31, 2025
1 parent ca1bdef commit 1bbfd0f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# CACHING
##########
- name: "cache node modules"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
java-version: '11.x'

- name: "cache maven dependencies"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: mapstore-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
# CACHING
##########
- name: "cache node modules"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -129,7 +129,7 @@ jobs:
${{ runner.os }}-
- name: "cache maven dependencies"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: mapstore-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# CACHING
##########
- name: "cache node modules"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -37,7 +37,7 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: "cache maven dependencies"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: mapstore-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# CACHING
##########
- name: "cache node modules"
uses: actions/cache@v1
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -54,7 +54,7 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: "cache maven dependencies"
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: mapstore-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -64,19 +64,19 @@ jobs:
id: "build"
run: "./build.sh ${{ github.event.inputs.version }} binary,printingbundle"
- name: "Upload war"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: war
name: release-war
path: product/target/mapstore.war
- name: "Upload binary"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: binary
name: release-binary
path: "binary/target/mapstore2-${{ github.event.inputs.version }}-bin.zip"
- name: "Upload printing"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: printing
name: release-printing
path: "java/printing/target/mapstore-printing.zip"
release:
runs-on: ubuntu-latest
Expand All @@ -86,12 +86,14 @@ jobs:
uses: actions/download-artifact@v3
with:
path: artifacts/
pattern: release-*
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R
working-directory: artifacts
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
run: echo "name=date::$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: create_release
id: create_release
uses: actions/create-release@v1
Expand Down Expand Up @@ -127,7 +129,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: artifacts/war/mapstore.war
asset_path: artifacts/mapstore.war
asset_name: mapstore.war
asset_content_type: application/zip
- name: Upload Release binary
Expand All @@ -137,7 +139,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: "artifacts/binary/mapstore2-${{github.event.inputs.version}}-bin.zip"
asset_path: "artifacts/mapstore2-${{github.event.inputs.version}}-bin.zip"
asset_name: "mapstore2-${{github.event.inputs.version}}-bin.zip"
asset_content_type: application/zip
- name: Upload Release printing
Expand All @@ -147,6 +149,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: artifacts/printing/mapstore-printing.zip
asset_path: artifacts/mapstore-printing.zip
asset_name: mapstore-printing.zip
asset_content_type: application/zip
8 changes: 4 additions & 4 deletions binary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@
<id>get-untar-jre-copy-db</id>
<phase>package</phase>
<configuration>
<tasks>
<target>
<echo message="Downloading JRE..."/>
<get src="https://www.dropbox.com/scl/fi/1joi5d3ol2zeex5cle2tg/jdk_11_0_23.tar.gz?rlkey=4vsmejq23xkpctsw6qifs6of6&amp;st=k4xtzt68&amp;dl=1"
dest="${project.build.directory}/jre.tar.gz"/>
<echo message="Untar JRE..."/>
<gunzip src="${project.build.directory}/jre.tar.gz"
dest="${project.build.directory}/jre.tar"/>
<untar src="${project.build.directory}/jre.tar" dest="${project.build.directory}/jre"/>
</tasks>
</target>
</configuration>
<goals>
<goal>run</goal>
Expand All @@ -133,12 +133,12 @@
<phase>package</phase>
<configuration>
<!-- remove some unwanted dependencies that get pulled over -->
<tasks>
<target>
<delete>
<fileset dir="${project.build.directory}/dependency"
includes="servlet-api-*.jar,core*.jar"/>
</delete>
</tasks>
</target>
</configuration>
<goals>
<goal>run</goal>
Expand Down

0 comments on commit 1bbfd0f

Please sign in to comment.