diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 221fc22..f25e629 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,10 @@ updates: schedule: interval: "daily" - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" \ No newline at end of file diff --git a/.github/workflows/dependabot-approve.yaml b/.github/workflows/dependabot-approve.yaml new file mode 100644 index 0000000..475842b --- /dev/null +++ b/.github/workflows/dependabot-approve.yaml @@ -0,0 +1,29 @@ +name: Dependabot auto-approve +on: pull_request + +permissions: read-all + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v1 + - uses: action@checkout@v4 + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Approve a PR if not already approved + run: | + gh pr checkout "$PR_URL" + if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; + then gh pr review --approve "$PR_URL" + else echo "PR already approved, skipping additional approvals to minimize emails/notification noise."; + fi + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..8e4f212 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,59 @@ +name: Wails build + +on: + push: + branches: + - 'main' + pull_request: + branches: + - 'main' + +env: + NODE_OPTIONS: "--max-old-space-size=4096" + +jobs: + build: + name: Build + strategy: + matrix: + build: + - name: 'MarshalController' + platform: 'windows/amd64' + os: 'windows' + runs-on: ${{ matrix.build.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Build wails + uses: dAppServer/wails-build-action@v2.2 + id: build + with: + build-name: ${{ matrix.build.name }} + build-platform: ${{ matrix.build.platform }} + go-version: '1.21' + create_release: + name: Create release + runs-on: ubuntu-latest + needs: build + permissions: + contents: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Create release tag + id: create_release + run: | + TAG="v$(date +'%d%m%Y')-$(echo ${{ github.sha }} | cut -c1-8)" + echo "Creating release tag $TAG" + echo "::set-output name=tag::$TAG" + - name: Create release + uses: ncipollo/release-action@v1 + with: + artifacts: "./artifacts/**/*" + generateReleaseNotes: true + tag: ${{ steps.create_release.outputs.tag }} +