From e6ac35ba344ad03844713f945a2d690fa79902d2 Mon Sep 17 00:00:00 2001 From: SylivanKenobi Date: Thu, 14 Sep 2023 16:05:30 +0200 Subject: [PATCH] add build step --- .github/workflows/slsa.yaml | 48 +++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/.github/workflows/slsa.yaml b/.github/workflows/slsa.yaml index a436d88ea0..f660acb88a 100644 --- a/.github/workflows/slsa.yaml +++ b/.github/workflows/slsa.yaml @@ -4,11 +4,51 @@ on: [push] permissions: read-all jobs: - build: + staging-okr-deploy: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout project + uses: actions/checkout@v2 + with: + token: ${{secrets.VERSION_TOKEN}} + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + server-id: github + settings-path: ${{github.workspace}} + + - name: Generate and Set New Version + run: mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false + + - name: Extract Maven project version + run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT + id: store-version + + + - name: Set New Snapshot Version + run: mvn build-helper:parse-version versions:set -DnewVersion=${{ steps.store-version.outputs.version}}-SNAPSHOT -DgenerateBackupPoms=false + + - name: Set up node 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Dependencies + run: cd ./frontend && npm ci + + - name: Build frontend with Angular + run: cd ./frontend && npm run build:staging + + - name: Build backend with Maven + run: mvn -B clean package --file pom.xml -P staging + + provenance: permissions: id-token: write # For signing. contents: read # For repo checkout of private repos. actions: read # For getting workflow run on private repos. - uses: slsa-framework/slsa-github-generator/.github/workflows/builder_maven_slsa3.yml@main - with: - directory: ./backend \ No newline at end of file + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_maven_slsa3.yml@main \ No newline at end of file