Skip to content

Add files via upload #163

Add files via upload

Add files via upload #163

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 }}
webapp--release_created: ${{ steps.release.outputs.webapp--release_created }}
webapp--version: ${{ steps.release.outputs.webapp--version }}
webapp--tag_name: ${{ steps.release.outputs.webapp--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 }}/playground-backend
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
webapp-release:
needs: release-please
if: needs.release-please.outputs.webapp--release_created
runs-on: ubuntu-latest
defaults:
run:
working-directory: webapp
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'webapp/.nvmrc'
cache: 'npm'
cache-dependency-path: 'webapp/package-lock.json'
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Create container image
env:
IMAGE_REPO: ghcr.io/${{ github.repository }}/webapp
IMAGE_TAG: ${{ needs.release-please.outputs.webapp--version }}
DOCKER_BUILDKIT: 1
run: |
# Convert to lowercase
IMAGE_REPO=$(echo $IMAGE_REPO | tr '[A-Z]' '[a-z]')
docker build -t $IMAGE_REPO:$IMAGE_TAG .
docker push $IMAGE_REPO:$IMAGE_TAG
docker tag $IMAGE_REPO:$IMAGE_TAG $IMAGE_REPO:latest
docker push $IMAGE_REPO:latest