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 6053769
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 48 deletions.
68 changes: 20 additions & 48 deletions .github/workflows/release-github-template.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,28 @@
name: "Release on Github"
name: "Release to github registry"

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

jobs:
create-github-release:
runs-on: ubuntu-latest
steps:
- name: Create github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: 'TODO'
draft: false
prerelease: false
outputs:
RELEASE_PATH: ${{ steps.create_release.outputs.upload_url }}

publish-to-github-maven-registry:
build:
uses: ./.github/workflows/build-all-template.yml
if: ${{ github.ref_name =~ ^\d+\.\d+\.\d+\.\d+$ }}
with:
release: true
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 }}
maven-username: ${{ github.actor }}
maven-password: ${{ secrets.GITHUB_TOKEN }}


upload-plugin-to-release:
needs: [ create-github-release]
runs-on: ubuntu-latest
steps:
- name: get plugin artifacts from build job
uses: actions/download-artifact@v4
with:
name: plugin-artifacts
path: artifacts

- name: Upload artifacts to github release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-github-release.outputs.RELEASE_PATH }}
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



File renamed without changes.
43 changes: 43 additions & 0 deletions .github/workflows/release-to-ossrh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Release to OSSRH"

on:
push:
tags:
- '[1-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
with:
publish-to-github-maven-registry: false

release-to-OSSRH:
needs: [ build ]
uses: ./.github/workflows/build-all-template.yml
with:
release: true
server-id: ossrh
secrets:
gpg-private-key: ${{secrets.CHUTNEY_GPG_PRIVATE_KEY}}
gpg-passphrase: ${{ secrets.CHUTNEY_GPG_PASSPHRASE }}
gpg-key-id: ${{ secrets.CHUTNEY_GPG_KEY_ID }}
maven-username: ${{ secrets.OSSRH_USERNAME }}
maven-password: ${{ secrets.OSSRH_PASSWORD }}

release-docker:
needs: [ build ]
uses: ./.github/workflows/release-docker-template.yml
with:
version: ${{needs.build.outputs.PROJECT_VERSION}}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6053769

Please sign in to comment.