Skip to content

Commit

Permalink
fix: switch to release-please (#26)
Browse files Browse the repository at this point in the history
* fix: switch to release-please

* shellcheck
  • Loading branch information
chgl authored Apr 6, 2024
1 parent 2562e7c commit b33f8fc
Show file tree
Hide file tree
Showing 14 changed files with 137 additions and 60 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ on:
pull_request:
branches:
- master
push:
branches:
- master
release:
types:
- created

permissions: read-all

jobs:
# on PRs keep building all images just to have a basic regression test
build:
uses: miracum/.github/.github/workflows/standard-build.yaml@c3f13dd53633bed28ff2667e559d74eae791a1a7 # v1.7.1
permissions:
Expand Down Expand Up @@ -57,14 +52,3 @@ jobs:
enable-verify-base-image-signature: false
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

release:
uses: miracum/.github/.github/workflows/standard-release.yaml@c3f13dd53633bed28ff2667e559d74eae791a1a7 # v1.7.1
needs:
- build
permissions:
contents: write
pull-requests: write
issues: write
secrets:
semantic-release-token: ${{ secrets.MIRACUM_BOT_SEMANTIC_RELEASE_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci

on:
release:
types:
- created

permissions: read-all

jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
component-name: ${{ steps.component-meta.outputs.component }}
component-version: ${{ steps.component-meta.outputs.image-version }}
steps:
- id: component-meta
shell: bash
run: |
tag="${{ github.ref_name }}"
regex="^(.*)-(v[0-9.]*(-.*)?)$"
if [[ $tag =~ $regex ]]; then
component_name="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}"
echo "Component Name: $component_name"
echo "Version: $version"
echo "component=$component_name" >>"$GITHUB_OUTPUT"
echo "version=$version" >>"$GITHUB_OUTPUT"
else
echo "tag format does not match."
exit 1
fi
build:
uses: miracum/.github/.github/workflows/standard-build.yaml@13d484d08281bdcb56393ed14cf15559212793b1 # v1.8.0
needs:
- prepare
permissions:
contents: read
id-token: write
packages: write
pull-requests: write
actions: read
security-events: write
with:
image: ghcr.io/${{ github.repository }}/${{ needs.prepare.outputs.component-name }}
build-context: images/${{ needs.prepare.outputs.component-name }}
enable-build-test-layer: false
enable-upload-test-image: false
enable-upload-image: false
image-tags: |
type=semver,pattern={{raw}},value=${{ needs.prepare.outputs.component-version }}
enable-trivy-scan: ${{ needs.prepare.outputs.component-name != 'ml-on-fhir' }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Release Please"

on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-22.04
steps:
- uses: google-github-actions/release-please-action@a37ac6e4f6449ce8b3f7607e4d97d0146028dc0b # v4.1.0
with:
token: ${{ secrets.MIRACUM_BOT_SEMANTIC_RELEASE_TOKEN }}
9 changes: 9 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"images/apache-superset": "1.5.2",
"images/coder-base": "1.5.2",
"images/cricketeerone-kafka-connect": "1.5.2",
"images/kyuubi-delta": "1.5.2",
"images/ml-on-fhir": "1.5.2",
"images/spark-delta": "1.5.2",
"images/strimzi-kafka-connect": "1.5.2"
}
43 changes: 0 additions & 43 deletions .releaserc.json

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ Collection of container images
name to the `jobs.build.strategy.matrix.image` array.
1. Update [schedule.yaml](.github/workflows/schedule.yaml) and add this folder
name to the `jobs.schedule.with.images` array.
1. Update [.release-please-manifest.json](.release-please-manifest.json) with
the new image and initial version.
1. Update [release-please-config.json](release-please-config.json) and add the image
to the `packages` section.
1 change: 1 addition & 0 deletions images/apache-superset/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
1 change: 1 addition & 0 deletions images/coder-base/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
1 change: 1 addition & 0 deletions images/cricketeerone-kafka-connect/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
1 change: 1 addition & 0 deletions images/kyuubi-delta/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
1 change: 1 addition & 0 deletions images/ml-on-fhir/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
1 change: 1 addition & 0 deletions images/spark-delta/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
1 change: 1 addition & 0 deletions images/strimzi-kafka-connect/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.2
39 changes: 39 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false,
"include-v-in-tag": true,
"separate-pull-requests": true,
"packages": {
"images/apache-superset": {
"component": "apache-superset",
"release-type": "simple"
},
"images/coder-base": {
"component": "coder-base",
"release-type": "simple"
},
"images/cricketeerone-kafka-connect": {
"component": "cricketeerone-kafka-connect",
"release-type": "simple"
},
"images/kyuubi-delta": {
"component": "kyuubi-delta",
"release-type": "simple"
},
"images/ml-on-fhir": {
"component": "ml-on-fhir",
"release-type": "simple"
},
"images/spark-delta": {
"component": "spark-delta",
"release-type": "simple"
},
"images/strimzi-kafka-connect": {
"component": "strimzi-kafka-connect",
"release-type": "simple"
}
}
}

0 comments on commit b33f8fc

Please sign in to comment.