-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ec232de
Showing
6 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Create a release tag and github release" | ||
description: "Create a release tag and github release" | ||
|
||
inputs: | ||
tag: | ||
description: 'Release tag (e.g. release/2.0.1)' | ||
required: true | ||
|
||
name: | ||
description: 'Release name, leave empty to use tag' | ||
required: false | ||
|
||
removeExistingReleaseAndTag: | ||
description: 'Remove existing release and tag' | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
artifacts: | ||
description: 'A glob or paths to artifacts to include in the release (e.g., releases/*)' | ||
required: true | ||
|
||
token: | ||
description: "Github token." | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Remove existing release and tag | ||
if: ${{ inputs.removeExistingReleaseAndTag }} | ||
shell: bash | ||
run: | | ||
if gh release delete "${{ inputs.tag }}" --yes --cleanup-tag; then | ||
echo "Release deleted: ${{ inputs.tag }}" | ||
# Wait a bit so that the deletion is confirmed and propagates. | ||
sleep 5 | ||
else | ||
echo "::warning::Can't delete an existing release with this tag: ${{ inputs.tag }}?" | ||
gh release list | ||
fi | ||
env: | ||
GH_TOKEN: ${{ inputs.token || github.token }} | ||
|
||
- name: Create release | ||
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 | ||
with: | ||
draft: false | ||
commit: ${{ github.ref }} | ||
tag: ${{ inputs.tag }} | ||
name: ${{ inputs.name }} | ||
artifacts: ${{ inputs.artifacts }} | ||
allowUpdates: false | ||
artifactErrorsFailBuild: true | ||
generateReleaseNotes: true | ||
token: ${{ inputs.token || github.token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Download release artifacts | ||
description: Download one or more artifacts (reusable infra action) | ||
|
||
inputs: | ||
release: | ||
description: "Release to download. Default 'latest'. If not 'latest', this has to be in the form tags/<tag_name> or <release_id>" | ||
required: true | ||
|
||
dir: | ||
description: "Target directory to write artifacts to." | ||
required: true | ||
|
||
repo: | ||
description: "The `org/repo` containing the release. Defaults to the current repo." | ||
required: false | ||
|
||
pattern: | ||
description: "Regexp pattern to match artifact names." | ||
default: "^.*$" | ||
required: false | ||
|
||
token: | ||
description: "Github token." | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create release artifact folders | ||
shell: bash | ||
run: | | ||
mkdir -p ${{ inputs.dir }} | ||
- name: Fetch release artifacts | ||
uses: dweiss/fetch-gh-release-asset@v1 | ||
with: | ||
repo: ${{ inputs.repo }} | ||
version: ${{ inputs.release }} | ||
file: ${{ inputs.pattern }} | ||
regex: true | ||
target: ${{ inputs.dir }} | ||
token: ${{ inputs.token || github.token }} | ||
|
||
- name: List downloaded release files | ||
shell: bash | ||
run: | | ||
ls -al ${{ inputs.dir }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Prepare local git clone" | ||
description: "Prepare local git clone" | ||
|
||
inputs: | ||
token: | ||
description: "Github token." | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Correct git autocrlf | ||
shell: bash | ||
run: git config --global core.autocrlf false | ||
|
||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
submodules: recursive | ||
token: ${{ inputs.token || github.token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "Prepare Gradle and Java build" | ||
description: "Prepare Gradle and Java build" | ||
|
||
inputs: | ||
jdk-version: | ||
required: true | ||
description: "JDK version to set up" | ||
|
||
jdk-distribution: | ||
required: false | ||
default: "temurin" | ||
description: "JDK distribution" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Set up JDK (${{ inputs.jdk-distribution }}, ${{ inputs.jdk-version }}) [buildjet]" | ||
if: ${{ contains(runner.name, 'buildjet') }} | ||
uses: buildjet/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.jdk-distribution }} | ||
java-version: ${{ inputs.jdk-version }} | ||
java-package: jdk | ||
|
||
- name: "Set up JDK (${{ inputs.jdk-distribution }}, ${{ inputs.jdk-version }}) [blacksmith]" | ||
if: ${{ contains(runner.name, 'blacksmith') }} | ||
uses: useblacksmith/setup-java@v5 | ||
with: | ||
distribution: ${{ inputs.jdk-distribution }} | ||
java-version: ${{ inputs.jdk-version }} | ||
java-package: jdk | ||
|
||
- name: "Set up JDK (${{ inputs.jdk-distribution }}, ${{ inputs.jdk-version }}) [github]" | ||
if: ${{ !contains(runner.name, 'buildjet') && !contains(runner.name, 'blacksmith') }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.jdk-distribution }} | ||
java-version: ${{ inputs.jdk-version }} | ||
java-package: jdk | ||
|
||
- name: Setup Gradle [blacksmith] | ||
if: ${{ contains(runner.name, 'blacksmith') }} | ||
uses: useblacksmith/setup-gradle/setup-gradle@v5 | ||
|
||
- name: Setup Gradle | ||
if: ${{ !contains(runner.name, 'buildjet') && !contains(runner.name, 'blacksmith') }} | ||
uses: gradle/actions/setup-gradle@v3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Prepare Java build" | ||
description: "Prepare Java build" | ||
|
||
inputs: | ||
jdk-version: | ||
required: true | ||
description: "JDK version to set up" | ||
|
||
jdk-distribution: | ||
required: false | ||
default: "temurin" | ||
description: "JDK distribution" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Set up JDK (${{ inputs.jdk-distribution }}, ${{ inputs.jdk-version }}) [buildjet]" | ||
if: ${{ contains(runner.name, 'buildjet') }} | ||
uses: buildjet/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.jdk-distribution }} | ||
java-version: ${{ inputs.jdk-version }} | ||
java-package: jdk | ||
|
||
- name: "Set up JDK (${{ inputs.jdk-distribution }}, ${{ inputs.jdk-version }}) [blacksmith]" | ||
if: ${{ contains(runner.name, 'blacksmith') }} | ||
uses: useblacksmith/setup-java@v5 | ||
with: | ||
distribution: ${{ inputs.jdk-distribution }} | ||
java-version: ${{ inputs.jdk-version }} | ||
java-package: jdk | ||
|
||
- name: "Set up JDK (${{ inputs.jdk-distribution }}, ${{ inputs.jdk-version }}) [github]" | ||
if: ${{ !contains(runner.name, 'buildjet') && !contains(runner.name, 'blacksmith') }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.jdk-distribution }} | ||
java-version: ${{ inputs.jdk-version }} | ||
java-package: jdk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |