Skip to content

Merge pull request #49 from nicholasM95/renovate/aws-5.x #74

Merge pull request #49 from nicholasM95/renovate/aws-5.x

Merge pull request #49 from nicholasM95/renovate/aws-5.x #74

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
branches:
- main
- develop
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
JAVA_VERSION: '21'
REGISTRY: ghcr.io
IMAGE_NAME: nicholasm95/api-skoda
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'liberica'
cache: 'maven'
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 20
- name: Install Semantic Release and plugins
run: |
npm install semantic-release @semantic-release/exec @semantic-release/changelog @semantic-release/github
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate next version
run: |
npx semantic-release --dry-run --no-ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SKIP_UPDATE_VERSION_IN_POM: true
- name: Build with Maven Wrapper
run: ./mvnw install
- name: Create Docker image
run: ./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$(cat .image_tag) -DskipTests
- name: Docker push
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$(cat .image_tag)
- name: Create Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update CHANGELOG.md
if: github.ref == 'refs/heads/main'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CHANGELOG.md
git commit -m "docs(CHANGELOG): Update CHANGELOG.md"
git push origin main
- name: Update develop branch
if: github.ref == 'refs/heads/main'
run: |
git fetch origin
git checkout develop
git merge --ff-only origin/main
git push origin develop