Skip to content

ci: release with dockerfile path #127

ci: release with dockerfile path

ci: release with dockerfile path #127

on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
packages: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
das_client--release_created: ${{ steps.release.outputs.das_client--release_created }}
das_client--version: ${{ steps.release.outputs.das_client--version }}
das_client--tag_name: ${{ steps.release.outputs.das_client--tag_name }}
playground-backend--release_created: ${{ steps.release.outputs.playground-backend--release_created }}
playground-backend--version: ${{ steps.release.outputs.playground-backend--version }}
playground-backend--tag_name: ${{ steps.release.outputs.playground-backend--tag_name }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
das-client-release:
needs: release-please
if: needs.release-please.outputs.das_client--release_created
runs-on: macos-latest
defaults:
run:
working-directory: das_client
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.2'
- run: flutter pub get
- run: flutter test
- run: flutter build appbundle
- name: Upload Release Artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.das_client--tag_name }} build/app/outputs/bundle/release/app-release.aab
backend-release:
needs: release-please
if: needs.release-please.outputs.playground-backend--release_created
runs-on: ubuntu-latest
defaults:
run:
working-directory: playground-backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io --username ${{ github.actor }} --password-stdin
- name: Create container image
env:
IMAGE_ID: ghcr.io/${{ github.repository }}
VERSION: ${{ needs.release-please.outputs.playground-backend--version }}
run: |
# Convert to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
mvn spring-boot:build-image \
-Dmaven.test.skip=true \
-Dspring-boot.build-image.imageName=$IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker tag $IMAGE_ID:$VERSION $IMAGE_ID:latest
docker push $IMAGE_ID:latest