Updated org.json:json to 20240303 (#354) #294
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: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: [ main ] | |
jobs: | |
tagged-release: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- run: bazel build //app:app_deploy.jar | |
name: Build project and jar | |
- run: mv bazel-bin/app/app_deploy.jar bazel-steward.jar | |
name: Rename jar | |
- uses: marvinpinto/[email protected] | |
name: Publish | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: ${{ github.ref_type != 'tag' }} | |
title: ${{ github.ref_type != 'tag' && 'Development Build' || null }} | |
automatic_release_tag: ${{ github.ref_type != 'tag' && 'latest' || null }} | |
files: bazel-steward.jar | |
maven-release: | |
runs-on: "ubuntu-latest" | |
if: github.ref_type == 'tag' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.PGP_SECRET }} | |
passphrase: ${{ secrets.PGP_PASSPHRASE }} | |
- run: | | |
RELEASE_VERSION="${GITHUB_REF#refs/*/v}" ./tools/publish/publish.sh | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
name: "Release to maven central" | |
prefix-version-tag: | |
runs-on: "ubuntu-latest" | |
if: github.ref_type == 'tag' | |
needs: tagged-release | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- run: | | |
set -x | |
GIT_TAG=$(echo "${{ github.event.ref }}" | grep -Eo 'v[\.0-9]*') | |
MINOR_TAG=$(echo "$GIT_TAG" | grep -Eo 'v[0-9]+\.[0-9]+') | |
MAJOR_TAG=$(echo "$GIT_TAG" | grep -Eo 'v[0-9]+') | |
for TAG in "$MINOR_TAG" "$MAJOR_TAG" | |
do | |
TAG_LATEST=$(git ls-remote --tags | grep -Eo "v[0-9]+\.[0-9]+\.[0-9]+" | grep -E "$TAG" | sort -Vr | head -n 1) | |
if [ "$GIT_TAG" == "$TAG_LATEST" ]; then | |
git tag -f "$TAG" "$GIT_TAG" | |
git push -f origin "$TAG" | |
fi | |
done |