Skip to content

ci(workflow): combine relase and build-package workflow #2

ci(workflow): combine relase and build-package workflow

ci(workflow): combine relase and build-package workflow #2

Workflow file for this run

name: "Create Release"
on:
workflow_dispatch:
push:
branches:
- "main"
permissions:
contents: read
jobs:
build:

Check failure on line 10 in .github/workflows/create_release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create_release.yml

Invalid workflow file

You have an error in your yaml syntax on line 10
name: Build SpringBooot-Jar
runs-on: ubuntu-latest
permissions:
contents: read
- name: Build bootJar
run: |
./gradlew :monitor:bootJar
- name: Upload Artifact
uese: actions/upload-artifact@v4
with:
name: bootjar
path: monitor/build/libs/monitor.jar
if-no-files-found: error
overwrite: true
release:
name: Generate Release
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
issues: write
pull-requests: write
outputs:
release_tag: ${{ steps.release.outputs.tag }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get SpringBoot-Jar
uses: actions/download-artifact@v4
with:
name: bootjar
path: monitor/build/libs/
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: "lts/*"
- name: Install NodeJS Dependencies
run: npm clean-install
- name: Verify the integrity and registry signatures for dependencies
run: npm audit signatures
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: Get Release Version
id: release
uses: GuillaumeFalourd/get-release-or-tag@v2
publish_package:
name: Publish runtime as Maven Package
runs-on: ubuntu-latest
needs:
- release
permissions:
- packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Push Package
env:
ACTOR: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.release.outputs.release_tag }}
run: |
./gradlew -Pversion=$TAG :runtime:publish
publish_container_image:
name: Publish Monitor as Container Image
runs-on: ubuntu-latest
needs:
- release
permissions:
- packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get SpringBoot-Jar
uses: actions/download-artifact@v4
with:
name: bootjar
path: monitor/build/libs/
- name: Build Monitor Image
working-directory: ./monitor
env:
RELEASE: ${{ needs.release.outputs.release_tag }}
run: |
docker build --file Dockerfile --tag ghcr.io/$GITHUB_REPOSITORY:$RELEASE --tag ghcr.io/$GITHUB_REPOSITORY:latest .
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image to Github Container Registry
run: |
docker push --all-tags ghcr.io/$GITHUB_REPOSITORY