Skip to content

Konverter til monorepo for beregning med forskudd beregning api #11

Konverter til monorepo for beregning med forskudd beregning api

Konverter til monorepo for beregning med forskudd beregning api #11

Workflow file for this run

name: Release Drafter
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: write
id-token: "write"
packages: "read"
env:
publish: ${{github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/dependabot')}}
jobs:
build-artifact:
name: "Build and run tests"
runs-on: ubuntu-latest
steps:
- run: |
echo ${{ github.ref }}
echo ${{ github.base_ref }}
echo ${{ github.head_ref }}
echo ${{ env.GITHUB_ACTOR }}
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
server-username: x-access-token
server-password: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve/Update Dependencies
run: mvn -B -q -fae package dependency:resolve-plugins dependency:go-offline
- name: Build (and run tests)
run: mvn -B -q -fae clean install
- name: Save test results
run: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
update_release_draft_labels:
if: github.ref != 'refs/heads/main'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update_release_draft:
needs: build-artifact
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setting version
id: set_version
run: |
export GIT_COMMIT_DATE=$(git log -1 --pretty='%ad' --date=format:'%Y.%m.%d.%H%M%S')
export VERSION=${GIT_COMMIT_DATE}
echo "VERSION=${GIT_COMMIT_DATE}" >> $GITHUB_ENV
echo "Setting version $VERSION"
- uses: release-drafter/release-drafter@v5
with:
version: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
name: "Release ${{ env.VERSION }}"
publish: ${{ env.publish }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
version: ${{ env.VERSION }}
published: ${{ env.publish == true }}
publish:
needs: update_release_draft
if: ${{ needs.update_release_draft.outputs.published }}
permissions:
contents: "write"
id-token: "write"
packages: "write"
name: Publish package
uses: ./.github/workflows/publish_dispatcher.yaml
with:
version: ${{ needs.update_release_draft.outputs.version }}
secrets: inherit