fix(deps): update dependency no.liflig:kotlin-parent to v2.20240509.0… #20
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: ci-lib | |
on: | |
push: | |
branches: | |
- "**" | |
defaults: | |
run: | |
# NOTE: A bit stricter than the default bash options used by GitHub Actions | |
# (bash --noprofile --norc -e -o pipefail {0}) | |
shell: bash --noprofile --norc -euo pipefail {0} | |
# NOTE: Set concurrency for the current workflow to 1 | |
concurrency: ci-${{ github.ref }}-${{ github.workflow }} | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
distribution: "zulu" | |
java-version: "17.0.9" | |
java-package: "jdk" | |
- uses: capralifecycle/actions-lib/check-runtime-dependencies@93a3def017e46bbf9fd49179f4ce752283157c85 # v1.3.2 | |
- name: cache mvn | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: release preparation | |
id: prep | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
major_version="$(sed -n "s/^.*<major-version>\([0-9]\{1,\}\)<\/major-version>.*$/\1/p" pom.xml)" | |
echo "$major_version" | grep -q "^[0-9]\{1,\}$" || { | |
echo "ERROR: Failed to extract <major-version> from pom.xml" | |
exit 1 | |
} | |
echo "major-version=$major_version" >> "$GITHUB_OUTPUT" | |
- uses: capralifecycle/actions-lib/generate-tag@93a3def017e46bbf9fd49179f4ce752283157c85 # v1.3.2 | |
id: tag | |
with: | |
tag-prefix: "${{ steps.prep.outputs.major-version }}" | |
tag-type: "punctuated-timestamp-tag" | |
- name: resolve dependencies | |
env: | |
# NOTE: Use the following token if your project does not depend on private packages: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn -B dependency:resolve | |
- name: conditional release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SHARED_SONAR_TOKEN }} | |
CONDITIONAL_RELEASE: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
TAG: "${{ steps.tag.outputs.tag }}" | |
run: | | |
if [ "$CONDITIONAL_RELEASE" = "true" ]; then | |
echo "Releasing library with tag '$TAG'" | |
# NOTE: Customize commands according to your project's needs, e.g.: | |
# mvn -B sonar:sonar sourceCjar deploy scm:tag -P gh-actions-build -DGIT_COMMIT_ID="$GITHUB_SHA" \ | |
# org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce -Drules=requireReleaseDeps | |
mvn -B source:jar deploy scm:tag -Drevision="$TAG" -Dtag="$TAG" \ | |
org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce -Drules=requireReleaseDeps | |
else | |
mvn -B -U verify | |
fi | |
- uses: capralifecycle/actions-lib/slack-notify@93a3def017e46bbf9fd49179f4ce752283157c85 # v1.3.2 | |
# NOTE: We only want to be notified about failures on the default branch | |
if: ${{ failure() && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
with: | |
bot-token: ${{ secrets.SHARED_SLACK_BOT_TOKEN }} | |
channel: "#sandbox-dev-info" |