test
This commit is contained in:
@@ -12,11 +12,6 @@ on:
|
||||
description: Branch reference
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
CI_BOT_USERNAME:
|
||||
required: true
|
||||
CI_BOT_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
publish-artifact:
|
||||
|
||||
@@ -8,29 +8,66 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: '17'
|
||||
PROJECT_VERSION:
|
||||
BRANCH_REFERENCE:
|
||||
description: Branch reference
|
||||
required: true
|
||||
type: string
|
||||
PROJECT_NAME:
|
||||
description: Project name
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
CI_BOT_USERNAME:
|
||||
required: true
|
||||
CI_BOT_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
publish-artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Print things
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
ref: ${{ inputs.BRANCH_REFERENCE }}
|
||||
token: ${{ secrets.CI_BOT_TOKEN }}
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ inputs.JAVA_VERSION }}
|
||||
- name: Extract project information
|
||||
id: project
|
||||
run: |
|
||||
echo "A: ${{ vars.BOT_NAME }}"
|
||||
echo "B: ${{ vars.BOT_EMAIL }}"
|
||||
echo "C: ${{ inputs.JAVA_VERSION }}"
|
||||
echo "D: ${{ inputs.PROJECT_VERSION }}"
|
||||
echo "E: ${{ inputs.PROJECT_NAME }}"
|
||||
echo "F: ${{ secrets.CI_BOT_USERNAME }}"
|
||||
NAME=$(awk -F '=' '/^rootProject\.name/{gsub(/[[:space:]]*/,"",$2); gsub(/"/,"",$2); print $2}' settings.gradle.kts)
|
||||
if [ -z "$NAME" ]; then
|
||||
echo "Error: No application name found in settings.gradle.kts" >&2
|
||||
exit 1
|
||||
fi
|
||||
VERSION=$(awk -F '=' '/^version[[:space:]]*=/{gsub(/[[:space:]]*/,"",$2); print $2}' gradle.properties)
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Error: No version found in gradle.properties" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "name=$NAME" >> $GITHUB_OUTPUT
|
||||
echo "Extracted application name: $NAME"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Extracted application version: $VERSION"
|
||||
- name: Build Docker Image
|
||||
run: ./gradlew dockerBuildImage
|
||||
env:
|
||||
REPOSITORY_USER: ${{ secrets.CI_BOT_USERNAME }}
|
||||
REPOSITORY_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
driver: docker-container
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.lulz.ltd
|
||||
username: ${{ secrets.CI_BOT_USERNAME }}
|
||||
password: ${{ secrets.CI_BOT_TOKEN }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./build/docker/
|
||||
platforms: linux/amd64
|
||||
provenance: false
|
||||
push: true
|
||||
sbom: false
|
||||
tags: |
|
||||
gitea.lulz.ltd/aura-ascend/${{ steps.project.outputs.name }}:${{ steps.project.outputs.version }}
|
||||
|
||||
@@ -23,19 +23,12 @@ on:
|
||||
description: Type of release (service, library, plugin, or catalog)
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
CI_BOT_USERNAME:
|
||||
required: true
|
||||
CI_BOT_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
project-name: ${{ steps.project.outputs.name }}
|
||||
release-version: ${{ steps.project.outputs.version }}
|
||||
has-changes: ${{ steps.project.outputs.change }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -51,11 +44,6 @@ jobs:
|
||||
- name: Extract project information
|
||||
id: project
|
||||
run: |
|
||||
NAME=$(awk -F '=' '/^rootProject\.name/ { gsub(/[[:space:]]*/,"",$2); gsub(/"/,"",$2); print $2 }' settings.gradle.kts)
|
||||
if [ -z "$NAME" ]; then
|
||||
echo "Error: No application name found in settings.gradle.kts" >&2
|
||||
exit 1
|
||||
fi
|
||||
VERSION=$(awk -F '=' '/^version[[:space:]]*=/{ gsub(/[[:space:]]*/,"",$2); sub(/-SNAPSHOT$/,"",$2); print $2 }' gradle.properties)
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Error: No version found in gradle.properties" >&2
|
||||
@@ -65,8 +53,6 @@ jobs:
|
||||
if [[ $(git log -1 --pretty=%B) != *"[RELEASE] - Bump version"* ]]; then
|
||||
CHANGE="true"
|
||||
fi
|
||||
echo "name=$NAME" >> $GITHUB_OUTPUT
|
||||
echo "Extracted application name: $NAME"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Extracted application version: $VERSION"
|
||||
echo "change=$CHANGE" >> $GITHUB_OUTPUT
|
||||
@@ -143,13 +129,9 @@ jobs:
|
||||
|
||||
finalise-publish-container:
|
||||
needs: release
|
||||
# if: needs.release.outputs.has-changes == 'true'
|
||||
# if: needs.release.outputs.has-changes == 'true' && inputs.RELEASE_TYPE == 'service'
|
||||
if: inputs.RELEASE_TYPE == 'service'
|
||||
uses: aura-ascend/common-workflows/.gitea/workflows/publish-container.yaml@master
|
||||
with:
|
||||
JAVA_VERSION: ${{ inputs.JAVA_VERSION }}
|
||||
# PROJECT_VERSION: ${{ needs.release.outputs.release-version }}
|
||||
PROJECT_VERSION: "v${{ needs.release.outputs.release-version }}"
|
||||
PROJECT_NAME: ${{ needs.release.outputs.project-name }}
|
||||
secrets: inherit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user