testing #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Java Layers | |
on: | |
push: | |
tags: | |
- v**_java | |
jobs: | |
publish-java: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-version: [ java8al2, java11, java17, java21 ] | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # pin@v4 | |
- name: Set up Java version | |
run: | | |
declare -A map_java_version | |
map_java_version=( | |
["java8al2"]="8" | |
["java11"]="11" | |
["java17"]="17" | |
["java21"]="21" | |
) | |
java_numeric_version=${map_java_version[${{ matrix.java-version }}]} | |
echo "JAVA_NUMERIC_VERSION=$java_numeric_version" >> $GITHUB_ENV | |
- name: Use Java ${{ env.JAVA_NUMERIC_VERSION }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: ${{ env.JAVA_NUMERIC_VERSION }} | |
- name: Check Tag | |
id: java-check-tag | |
run: | | |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+(\.[0-9]+)*_java$ ]]; then | |
echo "match=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Publish ${{ matrix.java-version }} layer | |
if: steps.java-check-tag.outputs.match == 'true' | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: make publish-${{ matrix.java-version }}-ci | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64, amd64 | |
- name: Publish ECR image for ${{ matrix.java-version }} | |
if: steps.java-check-tag.outputs.match == 'true' | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
cd java | |
./publish-layers.sh build-publish-${{ matrix.java-version }}-ecr-image |