Skip to content

Commit

Permalink
Add a job to build the pipelines and publish them
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Aug 6, 2024
1 parent 6c6823f commit bc757b6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Publish Pipelines generated when project is tagged
name: Publish Pipelines generated

on:
workflow_dispatch:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # release changes require contents write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: maven

- name: Build with Maven
run: mvn -B clean package

- name: Run the builder
run: |
cat <<EOF > cfg.yml
type: tekton
name: example
namespace:
job:
domain: example
resourceType: Pipeline
name: pipeline-1 # name of the pipeline to be created
description: Simple example of a Tekton pipeline echoing a message
EOF
java -jar target/quarkus-app/quarkus-run.jar -o out/flows -c cfg.yml
- name: Check Pipeline generated
run: cat out/flows/example/pipeline.yaml

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
**/*.yaml
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ job:
name: pipeline-1 # name of the pipeline to be created
description: Simple example of a Tekton pipeline echoing a message
EOF

java -jar target/quarkus-app/quarkus-run.jar -o out/flows -c cfg.yml
```
Resource generated:
```yaml
Expand Down Expand Up @@ -137,6 +139,7 @@ job:
name: pack-builder-push
description: "This Pipeline builds a builder image using the pack CLI."
EOF

java -jar target/quarkus-app/quarkus-run.jar -o out/flows -c cfg.yml
```
Resource generated:
Expand Down

0 comments on commit bc757b6

Please sign in to comment.