From 8bfd2d8700d02c2c5960ad35be2a5d0a61242326 Mon Sep 17 00:00:00 2001 From: Jan Robert Date: Mon, 18 Sep 2023 14:35:01 +0200 Subject: [PATCH] ci: automate approval process --- .github/workflows/3.approve-snapshot.yml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/3.approve-snapshot.yml diff --git a/.github/workflows/3.approve-snapshot.yml b/.github/workflows/3.approve-snapshot.yml new file mode 100644 index 000000000..ec27c8eb2 --- /dev/null +++ b/.github/workflows/3.approve-snapshot.yml @@ -0,0 +1,38 @@ +name: 3. Approve Snapshot + +on: + push: + branches: + - ci/approve-snapshot + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ldi-orchestrator + +jobs: + approve-snapshot: + #if: github.ref == "refs/heads/main" + name: Approve Snapshot and Promote + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up JDK 18 + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 18 + - name: Determine version + run: | + export VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) + echo "version=$VERSION" >> $GITHUB_ENV + - name: Define docker variables + run: | + if [[ "${{ env.version }}" != *"SNAPSHOT"* ]]; then + echo "Dealing with a snapshot version" + echo "${{ env.version }}" + fi + else + echo "Already released" + fi \ No newline at end of file