Skip to content

fix syntax on tags

fix syntax on tags #11

name: build gh release from tag
on:
push:
tags:
- "*/v*"
env:
REGISTRY: ghcr.io
jobs:
publish-ghcr-image:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/[email protected]
id: getTagNameParts
with:
tagRegex: (?<service>.*)\/v(?<version>.*) #example: backend/v1.2.3
tagRegexGroup: 0
- name: show-service
env:
ghRef: ${{ github.ref }}
service: ${{ steps.getTagNameParts.outputs.service }}
version: ${{ steps.getTagNameParts.outputs.version }}
tagFromAction: ${{ steps.getTagNameParts.outputs.tag }}
run: |
echo "Ref: $ghRef"
echo "Service: $service"
echo "Version: $version"
echo "tagFromAction: $tagFromAction"
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
cache: 'maven'
cache-dependency-path: '${{ steps.getTagNameParts.outputs.service }}/pom.xml'
java-version: '17'
distribution: 'temurin'
- name: build jar without tests
run: mvn -B -ntp -DskipTests package -f ${{ steps.getTagNameParts.outputs.service }}/pom.xml
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
${{ steps.getTagNameParts.outputs.service }}/target/*.jar
draft: false
prerelease: false
generate_release_notes: false