mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-29 08:13:53 +00:00
commit
45e89d12a8
13
.github/scripts/release-gradle-snapshot.sh
vendored
13
.github/scripts/release-gradle-snapshot.sh
vendored
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
POM_VERSION=$(gradle properties -q | grep "version:" | awk '{print $2}')
|
||||||
TAG="snapshot"
|
TAG="snapshot"
|
||||||
DATE_TIME_UTC=$(date -u +"%F at %T (UTC)")
|
DATE_TIME_UTC=$(date -u +"%F at %T (UTC)")
|
||||||
RELEASE_DIR="build/github_release"
|
RELEASE_DIR="build/github_release"
|
||||||
@ -15,17 +16,17 @@ mkdir "${RELEASE_DIR}"
|
|||||||
|
|
||||||
ln -s "../publications/maven/module.json" "${RELEASE_DIR}/plantuml-SNAPSHOT-module.json"
|
ln -s "../publications/maven/module.json" "${RELEASE_DIR}/plantuml-SNAPSHOT-module.json"
|
||||||
ln -s "../publications/maven/pom-default.xml" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom"
|
ln -s "../publications/maven/pom-default.xml" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom"
|
||||||
ln -s "../libs/plantuml.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar"
|
ln -s "../libs/plantuml-${POM_VERSION}.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar"
|
||||||
ln -s "../libs/plantuml-javadoc.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar"
|
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar"
|
||||||
ln -s "../libs/plantuml-sources.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar"
|
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar"
|
||||||
|
|
||||||
if [[ -e "build/publications/maven/module.json.asc" ]]; then
|
if [[ -e "build/publications/maven/module.json.asc" ]]; then
|
||||||
# signatures are optional so that forked repos can release snapshots without needing a gpg signing key
|
# signatures are optional so that forked repos can release snapshots without needing a gpg signing key
|
||||||
ln -s "../publications/maven/module.json.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-module.json.asc"
|
ln -s "../publications/maven/module.json.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-module.json.asc"
|
||||||
ln -s "../publications/maven/pom-default.xml.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom.asc"
|
ln -s "../publications/maven/pom-default.xml.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom.asc"
|
||||||
ln -s "../libs/plantuml.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar.asc"
|
ln -s "../libs/plantuml-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar.asc"
|
||||||
ln -s "../libs/plantuml-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar.asc"
|
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar.asc"
|
||||||
ln -s "../libs/plantuml-sources.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar.asc"
|
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar.asc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "${DATE_TIME_UTC}" > "${RELEASE_DIR}/plantuml-SNAPSHOT.timestamp"
|
echo -n "${DATE_TIME_UTC}" > "${RELEASE_DIR}/plantuml-SNAPSHOT.timestamp"
|
||||||
|
17
.github/scripts/release-gradle.sh
vendored
17
.github/scripts/release-gradle.sh
vendored
@ -1,14 +1,21 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
RELEASE_DIR="build/libs/github_release"
|
POM_VERSION=$(gradle properties -q | grep "version:" | awk '{print $2}')
|
||||||
|
RELEASE_DIR="build/github_release"
|
||||||
|
|
||||||
mkdir "${RELEASE_DIR}"
|
mkdir "${RELEASE_DIR}"
|
||||||
|
|
||||||
ln -s "../libs/plantuml.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar"
|
ln -s "../libs/plantuml-${POM_VERSION}.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar"
|
||||||
ln -s "../libs/plantuml-javadoc.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar"
|
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar"
|
||||||
ln -s "../libs/plantuml-sources.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar"
|
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar"
|
||||||
# we do not release the .pom or .asc signature files here, they will be added in a later PR
|
|
||||||
|
if [[ -e "build/publications/maven/module.json.asc" ]]; then
|
||||||
|
# signatures are optional so that forked repos can release snapshots without needing a gpg signing key
|
||||||
|
ln -s "../libs/plantuml-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar.asc"
|
||||||
|
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar.asc"
|
||||||
|
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar.asc"
|
||||||
|
fi
|
||||||
|
|
||||||
gh release create \
|
gh release create \
|
||||||
--target "${GITHUB_SHA}" \
|
--target "${GITHUB_SHA}" \
|
||||||
|
55
.github/workflows/ci-gradle.yml
vendored
55
.github/workflows/ci-gradle.yml
vendored
@ -66,17 +66,13 @@ jobs:
|
|||||||
|
|
||||||
# We run the tests on many OS / Java combinations but also the Compile step because some users build
|
# We run the tests on many OS / Java combinations but also the Compile step because some users build
|
||||||
# their own jars from source, so it is good for CI to check that is working on all combinations.
|
# their own jars from source, so it is good for CI to check that is working on all combinations.
|
||||||
build:
|
test:
|
||||||
needs: workflow_config
|
needs: workflow_config
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
java_version: [ 8, 11, 17 ]
|
java_version: [ 8, 11, 17 ]
|
||||||
os: [ macos-10.15, macos-11, ubuntu-18.04, ubuntu-20.04, windows-2019, windows-2022 ]
|
os: [ macos-10.15, macos-11, ubuntu-18.04, ubuntu-20.04, windows-2019, windows-2022 ]
|
||||||
include:
|
|
||||||
- release_from_this_build: true
|
|
||||||
os: ubuntu-20.04
|
|
||||||
java_version: 8
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
@ -96,15 +92,32 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: gradle -q test --no-daemon
|
run: gradle -q test --no-daemon
|
||||||
|
|
||||||
# The repeated "matrix.release_from_this_build" checks are messy, but I have not found a simple way to avoid them
|
upload:
|
||||||
# See https://github.com/actions/runner/issues/662
|
needs: [ workflow_config, test ]
|
||||||
|
if: needs.workflow_config.outputs.do_release == 'true' || needs.workflow_config.outputs.do_snapshot_release == 'true'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Create artifacts
|
- name: Set up java
|
||||||
if: matrix.release_from_this_build
|
uses: actions/setup-java@v2.5.0
|
||||||
run: gradle -q build -x test
|
with:
|
||||||
|
java-version: 17
|
||||||
|
distribution: temurin
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Set version from tag
|
||||||
|
if: env.POM_VERSION
|
||||||
|
env:
|
||||||
|
POM_VERSION: ${{ needs.workflow_config.outputs.pom_version }}
|
||||||
|
run: sed -i "s/version = .*/version = $POM_VERSION/" gradle.properties
|
||||||
|
|
||||||
|
- name: Build artifacts
|
||||||
|
run: gradle -q clean build generateMetadataFileForMavenPublication generatePomFileForMavenPublication -x test
|
||||||
|
|
||||||
- name: Setup gpg
|
- name: Setup gpg
|
||||||
if: matrix.release_from_this_build && env.ARTIFACT_SIGNING_KEY
|
if: env.ARTIFACT_SIGNING_KEY
|
||||||
id: gpg
|
id: gpg
|
||||||
env:
|
env:
|
||||||
ARTIFACT_SIGNING_KEY: ${{ secrets.ARTIFACT_SIGNING_KEY }}
|
ARTIFACT_SIGNING_KEY: ${{ secrets.ARTIFACT_SIGNING_KEY }}
|
||||||
@ -117,17 +130,16 @@ jobs:
|
|||||||
echo "::set-output name=key_id::${key_id}"
|
echo "::set-output name=key_id::${key_id}"
|
||||||
|
|
||||||
- name: Sign artifacts
|
- name: Sign artifacts
|
||||||
if: matrix.release_from_this_build && env.GPG_KEYNAME
|
if: env.GPG_KEYNAME
|
||||||
env:
|
env:
|
||||||
GPG_KEYNAME: ${{ steps.gpg.outputs.key_id }}
|
GPG_KEYNAME: ${{ steps.gpg.outputs.key_id }}
|
||||||
GPG_PASSPHRASE: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
|
GPG_PASSPHRASE: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
|
||||||
run: |
|
run: |
|
||||||
gradle sign "-Pversion=${POM_VERSION}"\
|
gradle sign \
|
||||||
"-Psigning.gnupg.keyName=${GPG_KEYNAME}" \
|
"-Psigning.gnupg.keyName=${GPG_KEYNAME}" \
|
||||||
"-Psigning.gnupg.passphrase=${GPG_PASSPHRASE}"
|
"-Psigning.gnupg.passphrase=${GPG_PASSPHRASE}"
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
if: matrix.release_from_this_build
|
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
# Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds
|
# Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds
|
||||||
@ -136,20 +148,6 @@ jobs:
|
|||||||
build/libs/*
|
build/libs/*
|
||||||
build/publications/maven/*
|
build/publications/maven/*
|
||||||
|
|
||||||
release:
|
|
||||||
needs: [ workflow_config, build ]
|
|
||||||
if: needs.workflow_config.outputs.do_release == 'true' || needs.workflow_config.outputs.do_snapshot_release == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout the repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: ${{ github.run_number }}-artifacts
|
|
||||||
path: build
|
|
||||||
|
|
||||||
- name: Create snapshot release
|
- name: Create snapshot release
|
||||||
if: needs.workflow_config.outputs.do_snapshot_release == 'true'
|
if: needs.workflow_config.outputs.do_snapshot_release == 'true'
|
||||||
env:
|
env:
|
||||||
@ -160,6 +158,5 @@ jobs:
|
|||||||
if: needs.workflow_config.outputs.do_release == 'true'
|
if: needs.workflow_config.outputs.do_release == 'true'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
POM_VERSION: ${{ needs.workflow_config.outputs.pom_version }}
|
|
||||||
TAG: ${{ github.event.ref }}
|
TAG: ${{ github.event.ref }}
|
||||||
run: .github/scripts/release-gradle.sh
|
run: .github/scripts/release-gradle.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user