Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CI-workflow: combine release and build-package workflow #131

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .github/workflows/build_packages.yml

This file was deleted.

77 changes: 74 additions & 3 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,42 @@ on:
permissions:
contents: read
jobs:
build:
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: Build bootJar
run: |
./gradlew :monitor:bootJar
- 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:
Expand All @@ -35,3 +56,53 @@ jobs:
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
Loading