Skip to content

spec: set ExclusiveArch on any OS with java_arches #89

spec: set ExclusiveArch on any OS with java_arches

spec: set ExclusiveArch on any OS with java_arches #89

Workflow file for this run

name: Publish JSS
on:
push:
branches:
- master
env:
NAMESPACE: ${{ vars.REGISTRY_NAMESPACE || github.repository_owner }}
jobs:
init:
name: Initialization
uses: ./.github/workflows/init.yml
secrets: inherit
if: vars.REGISTRY != ''
publish-maven:
name: Publishing Maven artifacts
needs: init
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Check settings.xml
run: |
cat ~/.m2/settings.xml
- name: Update pom.xml
run: |
sed -i \
-e "s/OWNER/$NAMESPACE/g" \
-e "s/REPOSITORY/jss/g" \
pom.xml
cat pom.xml
- name: Publish Maven artifacts
run: |
# TODO: Fix build issue in native and symkey modules.
mvn \
--batch-mode \
--update-snapshots \
-pl '!native,!symkey' \
deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
wait-for-images:
name: Waiting for container images
needs: init
runs-on: ubuntu-latest
steps:
- name: Wait for container images
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Building JSS'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
publish-images:
name: Publishing container images
needs: [init, wait-for-images]
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: vars.REGISTRY == 'ghcr.io'
- name: Log in to other container registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
if: vars.REGISTRY != 'ghcr.io'
- name: Retrieve jss-dist image
uses: actions/cache@v3
with:
key: jss-dist-${{ github.sha }}
path: jss-dist.tar
- name: Publish jss-dist image
run: |
docker load --input jss-dist.tar
docker tag jss-dist ${{ vars.REGISTRY }}/$NAMESPACE/jss-dist:latest
docker push ${{ vars.REGISTRY }}/$NAMESPACE/jss-dist:latest