Skip to content

Commit

Permalink
Get latest Quarkus version from maven repo metadata
Browse files Browse the repository at this point in the history
Even if 1.8.1 is the latest version, if 1.7.5 gets released after 1.8.1,
github will return 1.7.5 as the latest. Using maven's repo metadata
to get the latest version fixes this.
  • Loading branch information
zakkak committed Oct 7, 2020
1 parent 2d18b94 commit 1f8d1ff
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/quarkus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,29 @@ jobs:
path: mandreljdk.tgz

build-quarkus:
name: ${{ matrix.category }} build
name: ${{ matrix.quarkus-name }} build
runs-on: ubuntu-18.04
needs: build-mandrel
strategy:
matrix:
category: [quarkus-release, quarkus-master]
quarkus-name: [release, master]
include:
- category: quarkus-release
quarkus-url: $(curl -sL https://api.github.com/repos/quarkusio/quarkus/releases/latest | jq -r .tarball_url)
quarkus-name: release
- category: quarkus-master
quarkus-url: https://api.github.com/repos/quarkusio/quarkus/tarball/master
quarkus-name: master
- quarkus-name: release
quarkus-version: $(curl https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/latest/ {print $3}')
- quarkus-name: master
quarkus-version: master
steps:
- name: Get quarkus
run: |
curl --output quarkus.tgz -sL ${{ matrix.quarkus-url }}
curl --output quarkus.tgz -sL https://api.github.com/repos/quarkusio/quarkus/tarball/${{ matrix.quarkus-version }}
mkdir ${GITHUB_WORKSPACE}/quarkus
tar xf quarkus.tgz -C ${GITHUB_WORKSPACE}/quarkus --strip-components=1
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.quarkus-name }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-${{ matrix.quarkus-version }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.quarkus-name }}-maven-
${{ runner.s }}-${{ matrix.quarkus-version }}-maven-
- name: Download Mandrel build
uses: actions/download-artifact@v1
with:
Expand Down Expand Up @@ -147,9 +145,9 @@ jobs:
category: [Main, Data1, Data2, Data3, Data4, Data5, Data6, Security1, Security2, Security3, Amazon, Messaging, Cache, HTTP, Misc1, Misc2, Misc3, Misc4, Spring, gRPC]
include:
- quarkus-name: release
quarkus-url: $(curl -sL https://api.github.com/repos/quarkusio/quarkus/releases/latest | jq -r .tarball_url)
quarkus-version: $(curl https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/latest/ {print $3}')
- quarkus-name: master
quarkus-url: https://api.github.com/repos/quarkusio/quarkus/tarball/master
quarkus-version: master
- category: Main
postgres: "true"
timeout: 40
Expand Down Expand Up @@ -403,7 +401,7 @@ jobs:
run: tar -xzvf mandreljdk.tgz -C ~
- name: Get quarkus
run: |
curl --output quarkus.tgz -sL ${{ matrix.quarkus-url }}
curl --output quarkus.tgz -sL https://api.github.com/repos/quarkusio/quarkus/tarball/${{ matrix.quarkus-version }}
mkdir ${GITHUB_WORKSPACE}/quarkus
tar xf quarkus.tgz -C ${GITHUB_WORKSPACE}/quarkus --strip-components=1
- name: Reclaim disk space
Expand Down

0 comments on commit 1f8d1ff

Please sign in to comment.