Skip to content

Standard Build

Standard Build #284

Workflow file for this run

# The GitHub Actions file
name: Standard Build
on:
push:
workflow_dispatch:
inputs:
# These can be set when the build is invoked manually, from GH Actions.
#
# Set BOTH when you want to trigger a new release. The build script will
# switch Maven to the new release, deploy, tag git, move Maven to the new snapshot
#
NEW_RELEASE_VER:
description: "New Release Version"
required: false
NEW_SNAPSHOT_VER:
description: "New Snapshot Version"
required: false
permissions:
# needed to push and when the repo belongs to an organisation.
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 21
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Avoids re-listing all the secrets again. As they recommend, use the commit hash to point to
# an exact version, using tags might be compromised by malicious commits.
#
# See knetminer-ci docs for a list of secrets and other variables we use.
#
- name: Forward all GH secrets to env
uses: oNaiPs/secrets-to-env-action@75f319b3c8c926ac2eabcca34daa6cf531daf32f
with:
secrets: ${{ toJSON(secrets) }}
- name: Build
# You still need this for variables that aren't secrets, but better than nothing
env:
GIT_USER: ${{github.actor}}
GIT_PASSWORD: ${{github.GITHUB_TOKEN}}
CI_NEW_RELEASE_VER: ${{github.event.inputs.NEW_RELEASE_VER}}
CI_NEW_SNAPSHOT_VER: ${{github.event.inputs.NEW_SNAPSHOT_VER}}
CI_TRIGGERING_EVENT: ${{github.event_name}}
# We reuse the general CI scripts in knetminer-common, see https://github.com/KnetMiner/knetminer-ci
run:
./ci-build-v2/java-maven/build.sh