Skip to content

Commit

Permalink
fix: Regex does not work in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrouand committed Mar 22, 2024
1 parent dc06444 commit f5ecd67
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/release-github-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ name: "Release on Github"

on:
workflow_call:

inputs:
publish-to-github-maven-registry:
default: true
type: boolean
description: "Skip publish-to-github-maven-registry if false"
jobs:
create-github-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create github release
id: create_release
Expand All @@ -23,7 +29,7 @@ jobs:

publish-to-github-maven-registry:
uses: ./.github/workflows/build-all-template.yml
if: ${{ github.ref_name =~ ^\d+\.\d+\.\d+\.\d+$ }}
if: ${{inputs.publish-to-github-maven-registry}}
with:
release: true
secrets:
Expand All @@ -33,6 +39,8 @@ jobs:


upload-plugin-to-release:
permissions:
contents: write
needs: [ create-github-release]
runs-on: ubuntu-latest
steps:
Expand All @@ -51,6 +59,5 @@ jobs:
asset_path: artifacts/idea-plugin/build/distributions/chutney-idea-plugin-${{ github.ref_name }}.zip
asset_name: chutney-idea-plugin-${{ github.ref_name }}.zip
asset_content_type: application/zip



28 changes: 28 additions & 0 deletions .github/workflows/release-to-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Release to github registry"

on:
push:
tags:
- '[1-9]+.[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
uses: ./.github/workflows/build-all-template.yml
with:
skipTests: true
cache-artifacts: |
chutney/packaging/local-dev/target/chutney-local-dev-*.jar
idea-plugin/build/distributions/*.zip
chutney/ui/dist
release-github:
needs: [ build ]
uses: ./.github/workflows/release-github-template.yml

release-docker:
needs: [ build ]
uses: ./.github/workflows/release-docker-template.yml
with:
version: ${{needs.build.outputs.PROJECT_VERSION}}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "Release all"
name: "Release to OSSRH"

on:
push:
tags:
- '*.*.*'
- '*.*.*.*'
- '[1-9]+.[0-9]+.[0-9]+'

jobs:
build:
Expand All @@ -19,9 +18,10 @@ jobs:
release-github:
needs: [ build ]
uses: ./.github/workflows/release-github-template.yml
with:
publish-to-github-maven-registry: false

release-to-OSSRH:
if: ${{ github.ref_name =~ ^\d+\.\d+\.\d+$) }}
needs: [ build ]
uses: ./.github/workflows/build-all-template.yml
with:
Expand All @@ -41,4 +41,3 @@ jobs:
version: ${{needs.build.outputs.PROJECT_VERSION}}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f5ecd67

Please sign in to comment.