Skip to content

Commit

Permalink
release tags should start with v
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetancollaud committed Aug 16, 2024
1 parent 6964290 commit c1b3ffa
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 11 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build-aggregator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
tags:
- '*'
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ master ]
paths: ['aggregator/**']
Expand All @@ -16,6 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Write release version
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -66,4 +73,4 @@ jobs:
context: aggregator/
file: aggregator/src/main/docker/Dockerfile.jvm
push: true
tags: spoud/kafka-cost-control:${{ github.ref_name }}
tags: spoud/kafka-cost-control:${VERSION}
11 changes: 9 additions & 2 deletions .github/workflows/build-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
tags:
- '*'
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ master ]
paths: [ 'frontend/**' ]
Expand All @@ -16,6 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Write release version
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install dependencies
working-directory: frontend/
run: npm install
Expand Down Expand Up @@ -72,4 +79,4 @@ jobs:
with:
context: frontend/
push: true
tags: spoud/kafka-cost-control-ui:${{ github.ref_name }}
tags: spoud/kafka-cost-control-ui:${VERSION}
11 changes: 9 additions & 2 deletions .github/workflows/build-kafka-connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
tags:
- '*'
- 'v[0-9]+.[0-9]+.[0-9]+'
paths: ['kafka-connect/**']

jobs:
Expand All @@ -14,6 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Write release version
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -34,4 +41,4 @@ jobs:
with:
context: kafka-connect/
push: true
tags: spoud/kafka-cost-control-connect:${{ github.ref_name }}
tags: spoud/kafka-cost-control-connect:${VERSION}
13 changes: 10 additions & 3 deletions .github/workflows/build-scraper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
tags:
- '*'
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ master ]
paths: ['kafka-scraper/**']
Expand All @@ -16,6 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Write release version
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -63,7 +70,7 @@ jobs:
context: kafka-scraper/
file: kafka-scraper/src/main/docker/Dockerfile.jvm
push: true
tags: spoud/kafka-cost-control-scraper:${{ github.ref_name }}-jvm
tags: spoud/kafka-cost-control-scraper:${VERSION}-jvm

- name: Build and push tagged native image
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -72,4 +79,4 @@ jobs:
context: kafka-scraper/
file: kafka-scraper/src/main/docker/Dockerfile.native-micro
push: true
tags: spoud/kafka-cost-control-scraper:${{ github.ref_name }}-native
tags: spoud/kafka-cost-control-scraper:${VERSION}-native
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

name: Create Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Releases are made through git tags using semantic versioning. Where `MAJOR.MINOR
- `MINOR` version when you add functionality in a backwards compatible manner, and
- `PATCH` version when you make backwards compatible bug fixes or dependencies update.

To create a release you should push a tag to the master branch. For example
To create a release you should push a tag starting with `v`to the master branch. For example
```bash
git tag 0.1.2
git tag v0.1.2
git push --tags
```

0 comments on commit c1b3ffa

Please sign in to comment.