Skip to content
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
35 changes: 3 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,18 @@ on:

jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Compute tag
id: version
uses: h2-invent/action-compute-tag@v2.2.0
with:
event-name: ${{ github.event_name }}
base-ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.event.pull_request.base.ref }}
pr-action: ${{ github.event.action }}
pr-merged: ${{ github.event.pull_request.merged }}

- name: Create new Release with semantic-version tag
uses: ncipollo/release-action@v1
id: create_release
with:
draft: false
prerelease: false
allowUpdates: true
name: Release ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
bodyFile: RELEASE_NOTE.md
uses: ./.github/workflows/task-version.yml

docker_image:
needs:
- version
uses: ./.github/workflows/task-docker.yml
if: needs.version.outputs.skip != 'true'
with:
registry: reg.h2-invent.com
dockerfile_path: './Dockerfile'
directory: '.'
version: ${{ needs.version.outputs.version }}
tags: reg.h2-invent.com/filemanager/core:${{ needs.version.outputs.version }},reg.h2-invent.com/filemanager/core:latest
version: ${{ needs.version.outputs.version_output }}
tags: reg.h2-invent.com/filemanager/core:${{ needs.version.outputs.version_output }},reg.h2-invent.com/filemanager/core:latest
secrets:
docker_password: ${{ secrets.HARBOR_PUSH_PASSWORD }}
docker_username: ${{ secrets.HARBOR_PUSH_USERNAME }}

22 changes: 22 additions & 0 deletions .github/workflows/task-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Version

on:
workflow_call:
inputs:
version:
description: 'release version'
default: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Create new Release with semantic-version tag
uses: ncipollo/release-action@v1
with:
draft: false
prerelease: false
allowUpdates: true
name: Release ${{ inputs.version }}
tag: ${{ inputs.version }}
bodyFile: RELEASE_NOTE.md
39 changes: 39 additions & 0 deletions .github/workflows/task-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Docker image

on:
workflow_call:
outputs:
version_output:
description: Output next build version
value: ${{ jobs.detect_version.outputs.version }}
jobs:
detect_version:
name: Generate new Release Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: paulhatch/semantic-version@v5.0.2
id: version
with:
tag_prefix: ""
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
change_path: .
version_format: "${major}.${minor}.${patch}"

- name: Create new Release with semantic-version tag
uses: ncipollo/release-action@v1
id: create_release
with:
draft: false
prerelease: false
allowUpdates: true
name: Release ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
bodyFile: RELEASE_NOTE.md
Loading