diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e69de29 diff --git a/.github/release-drafter.yaml b/.github/release-drafter.yaml new file mode 100644 index 0000000..1de4582 --- /dev/null +++ b/.github/release-drafter.yaml @@ -0,0 +1,26 @@ +name-template: $NEXT_PATCH_VERSION +tag-template: $NEXT_PATCH_VERSION +change-template: '- $TITLE (#$NUMBER) @$AUTHOR' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '⚠️ Breaking Changes' + labels: + - 'breaking' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'chore' + - title: '⬆️ Dependency upgrades' + labels: + - 'bump' + - 'dependencies' +template: | + ## What's Changed + $CHANGES \ No newline at end of file diff --git a/.github/workflows/build-deploy-bidrag-domene.yml b/.github/workflows/build-deploy-bidrag-domene.yml index 71673ed..0c824de 100644 --- a/.github/workflows/build-deploy-bidrag-domene.yml +++ b/.github/workflows/build-deploy-bidrag-domene.yml @@ -1,18 +1,18 @@ -name: Bidrag-domene -on: - push: - paths: - - "bidrag-domene/**" - -permissions: - contents: "write" - id-token: "write" - packages: "write" - -jobs: - build-and-release: - name: Build and release package - uses: ./.github/workflows/build_and_release_package.yml - with: - package-name: bidrag-domene - secrets: inherit \ No newline at end of file +#name: Bidrag-domene +#on: +# push: +# paths: +# - "bidrag-domene/**" +# +#permissions: +# contents: "write" +# id-token: "write" +# packages: "write" +# +#jobs: +# build-and-release: +# name: Build and release package +# uses: ./.github/workflows/build_and_release_package.yml +# with: +# package-name: bidrag-domene +# secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build-deploy-bidrag-transport.yml b/.github/workflows/build-deploy-bidrag-transport.yml index a07617a..6a61a4c 100644 --- a/.github/workflows/build-deploy-bidrag-transport.yml +++ b/.github/workflows/build-deploy-bidrag-transport.yml @@ -1,18 +1,18 @@ -name: Bidrag-transport -on: - push: - paths: - - "bidrag-transport/**" - -permissions: - contents: "write" - id-token: "write" - packages: "write" - -jobs: - build-and-release: - name: Build and release package - uses: ./.github/workflows/build_and_release_package.yml - with: - package-name: bidrag-transport - secrets: inherit \ No newline at end of file +#name: Bidrag-transport +#on: +# push: +# branches: +# - "" +# +#permissions: +# contents: "write" +# id-token: "write" +# packages: "write" +# +#jobs: +# build-and-release: +# name: Build and release package +# uses: ./.github/workflows/build_and_release_package.yml +# with: +# package-name: bidrag-transport +# secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build_and_release_package.yml b/.github/workflows/build_and_release_package.yml index aab0ae2..267bdef 100644 --- a/.github/workflows/build_and_release_package.yml +++ b/.github/workflows/build_and_release_package.yml @@ -35,7 +35,5 @@ jobs: name: Release package needs: build-artifact if: github.base_ref == 'main' || github.ref == 'refs/heads/main' - uses: ./.github/workflows/release_package.yml - with: - package-name: ${{inputs.package-name}} + uses: ./.github/workflows/release_package_v2.yml secrets: inherit \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..fadcc06 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,31 @@ +name: Publish artifacts +on: + release: + types: [published] +env: + VERSION: ${{ github.event.release.tag_name }} + +permissions: + contents: "write" + id-token: "write" + packages: "write" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + cache: 'maven' + - name: Deploy to Github Package + run: | + echo "Release package ${{inputs.package-name}} with version ${{ env.VERSION }}" + # mvn source:jar-no-fork deploy -DskipTests=true -Dmaven.wagon.http.pool=false + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{inputs.package-name}}_${{env.VERSION}} + name: ${{inputs.package-name}}:${{env.VERSION}} \ No newline at end of file diff --git a/.github/workflows/release-draft.yaml b/.github/workflows/release-draft.yaml new file mode 100644 index 0000000..3707047 --- /dev/null +++ b/.github/workflows/release-draft.yaml @@ -0,0 +1,24 @@ +name: Release Drafter + +on: + push: + branches: + - main + pull_request: + types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + version: + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release_package.yml b/.github/workflows/release_package.yml index 31f5d7b..0e1e7f8 100644 --- a/.github/workflows/release_package.yml +++ b/.github/workflows/release_package.yml @@ -28,9 +28,9 @@ jobs: - name: Deploy to Github Package run: | echo "Release package ${{inputs.package-name}} with version ${{ env.VERSION }}" -# mvn --settings source:jar-no-fork deploy -DskipTests=true -Dmaven.wagon.http.pool=false --pl ${{inputs.package-name}} --am +# mvn source:jar-no-fork deploy -DskipTests=true -Dmaven.wagon.http.pool=false --pl ${{inputs.package-name}} --am - name: Create a GitHub release uses: ncipollo/release-action@v1 with: tag: ${{inputs.package-name}}_${{env.VERSION}} - name: Release ${{inputs.package-name}}:${{env.VERSION}} \ No newline at end of file + name: ${{inputs.package-name}}:${{env.VERSION}} \ No newline at end of file diff --git a/.github/workflows/release_package_v2.yml b/.github/workflows/release_package_v2.yml new file mode 100644 index 0000000..8aff5ac --- /dev/null +++ b/.github/workflows/release_package_v2.yml @@ -0,0 +1,31 @@ +name: Release package +on: + workflow_call: + inputs: + package-name: + required: true + type: string + description: Navn på pakken som skal publiseres + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + cache: 'maven' + - name: Setting 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" + mvn versions:set -DnewVersion="$VERSION" + mvn versions:commit + - name: Deploy to Github Package + run: | + echo "Release package ${{inputs.package-name}} with version ${{ env.VERSION }}" +# mvn --settings source:jar-no-fork deploy -DskipTests=true -Dmaven.wagon.http.pool=false --pl ${{inputs.package-name}} --am \ No newline at end of file