Skip to content

Release/test #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 48 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,11 @@ jobs:
with:
fetch-depth: '0'

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/org/devgateway/tcdi
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "Timothy Mugo Gachengo"

- name: Build the Maven project
run: |
mvn package -DskipTests=true -Dcheckstyle.skip \
&& mkdir -p forms/target/deps \
&& cd forms/target/deps \
&& jar -xf ../*.jar

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: changelog
with:
config: cliff.toml
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate Tag
id: tag_version
uses: mathieudutour/[email protected]
Expand All @@ -73,8 +39,11 @@ jobs:
dry_run: 'true'

build-and-push-docker-image:
needs: release-and-tag
needs: prepare-a-release
runs-on: ubuntu-latest
outputs:
new_version: ${{ needs.prepare-a-release.outputs.new_version }}
new_tag: ${{ needs.prepare-a-release.outputs.new_tag }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -103,22 +72,61 @@ jobs:
context: .
push: true
build-args: |
VERSION=${{ needs.release-and-tag.outputs.new_version }}
TAG=${{ needs.release-and-tag.outputs.new_version }}
VERSION=${{ needs.prepare-a-release.outputs.new_version }}
TAG=${{ needs.prepare-a-release.outputs.new_tag }}
tags: |
${{ vars.DOCKER_REGISTRY }}/data-viz-admin:latest
${{ vars.DOCKER_REGISTRY }}/data-viz-admin:v${{ needs.release-and-tag.outputs.new_version }}
${{ vars.DOCKER_REGISTRY }}/data-viz-admin:v${{ needs.prepare-a-release.outputs.new_version }}

release-on-github:
needs: build-and-push-docker-image
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/org/devgateway/tcdi
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build the Maven project
run: |
mvn package -DskipTests=true -Dcheckstyle.skip \
&& mkdir -p forms/target/deps \
&& cd forms/target/deps \
&& jar -xf ../*.jar

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: changelog
with:
config: cliff.toml
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release-and-tag.outputs.new_tag }}
files: forms/target/deps/*.jar
tag_name: ${{ needs.build-and-push-docker-image.outputs.new_tag }}
files: forms/target/*.jar
body_path: CHANGELOG.md
draft: false
prerelease: false
Expand Down
5 changes: 4 additions & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@ filter_commits = false
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"
sort_commits = "newest"

[bump]
initial_tag = "v1.0.0"
Loading