From 51c07395627b9ba9abb8373fd69865f6978e9e30 Mon Sep 17 00:00:00 2001 From: Runar Skagestad Date: Sun, 29 Sep 2024 19:02:01 +0200 Subject: [PATCH 1/3] Ta i bruk gjenbrukbar GA-workflow for PR-sjekk --- .github/workflows/pr.yml | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d457fca..0534d3d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,21 +1,10 @@ -name: Pull Request +name: Bygg app og kjør tester + on: - pull_request: workflow_dispatch: + pull_request: jobs: build: - name: Build and test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - cache: 'gradle' - - - uses: gradle/actions/setup-gradle@v3 - with: - arguments: build + name: "Bygger prosjektet, sjekker linting og kjører testene" + uses: navikt/tilleggsstonader/.github/workflows/java-build-and-test.yml@main From c3016b3d3cd96bd4fd5fc2e863f80de27804e53e Mon Sep 17 00:00:00 2001 From: Runar Skagestad Date: Sun, 29 Sep 2024 19:29:26 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Innnsending=20av=20avhengighetsgraf=20bruke?= =?UTF-8?q?r=20n=C3=A5=20felles=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/submit-dependency-graph.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/submit-dependency-graph.yml diff --git a/.github/workflows/submit-dependency-graph.yml b/.github/workflows/submit-dependency-graph.yml new file mode 100644 index 0000000..f54d98b --- /dev/null +++ b/.github/workflows/submit-dependency-graph.yml @@ -0,0 +1,17 @@ +name: Send inn avhengighetsgraf til GitHub Security + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "**.gradle.kts" + - "gradle.properties" + +jobs: + submit-dependency-graph: + name: "Genererer opp avhengighetsgraf og sender den til GHAS" + uses: navikt/tilleggsstonader/.github/workflows/submit-dependency-graph.yml@main + permissions: + contents: "write" # Kreves av Dependency Submission API-et From 429ce084fe8b0899fb5eee118e831f1cc391e8ea Mon Sep 17 00:00:00 2001 From: Runar Skagestad Date: Mon, 30 Sep 2024 09:04:20 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Ta=20i=20bruk=20gjenbrukbar=20workflow=20fo?= =?UTF-8?q?r=20=C3=A5=20publisere=20pakker=20p=C3=A5=20ghpr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-deploy.yml | 70 +++--------------------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index f2757f5..fb50819 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -1,73 +1,15 @@ -name: Build and Deploy +name: Bygg og publiser pakke på GitHub Packages + on: push: branches: - 'main' jobs: - build: - name: Build and test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - cache: 'gradle' - - - uses: gradle/actions/setup-gradle@v3 - with: - arguments: build - - - name: Post build failures to Slack - if: failure() - run: | - curl -X POST --data "{\"text\": \"Build av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL - env: - WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - release: - name: Create Release - needs: build - runs-on: ubuntu-latest + build_and_deploy: + name: "Opprett og publiser leveranse på GitHub Packages" + uses: navikt/tilleggsstonader/.github/workflows/java-build-and-publish-release.yml@main + secrets: inherit permissions: contents: write packages: write - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set release tag - run: | - export TAG_NAME="$(TZ="Europe/Oslo" date +%Y.%m.%d-%H.%M).$(git rev-parse --short=12 HEAD)" - echo "RELEASE_TAG=$TAG_NAME" >> $GITHUB_ENV - #- name: Set changelog - # id: changelog - # # (Escape newlines see https://github.com/actions/create-release/issues/25) - # run: | - # text="$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")" - # echo "::set-output name=CHANGELOG::$text" - - - name: Create release - uses: softprops/action-gh-release@v2 - with: - name: Release ${{ env.RELEASE_TAG }} - tag_name: ${{ env.RELEASE_TAG }} - draft: false - prerelease: false - - - name: Publish - uses: gradle/actions/setup-gradle@v3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - arguments: -Pversion=${{ env.RELEASE_TAG }} publish - - - name: Post release failures to Slack - if: failure() - run: | - curl -X POST --data "{\"text\": \"Release av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL - env: - WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}