From 14e03763026da98bf07f366046c188489c8ca522 Mon Sep 17 00:00:00 2001 From: Andreas Palm Date: Mon, 18 Nov 2024 11:34:32 +0100 Subject: [PATCH] chore(ci): Comment push and dependabot steps --- .github/workflows/ci.yml | 186 +++++++++++++++++----------------- .github/workflows/release.yml | 16 --- 2 files changed, 93 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86ea6932..845f052e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,96 +137,96 @@ jobs: - name: Run make test run: docker compose run --rm dev make test - - name: Login to Docker Hub - uses: docker/login-action@v3 - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate Docker image tags - id: meta - uses: docker/metadata-action@v5 - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} - with: - images: | - ${{ github.repository }} - ghcr.io/${{ github.repository }} - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - - name: Publish Docker image - uses: docker/build-push-action@v6 - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} - with: - context: . - target: release - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - npm: - name: NPM - runs-on: ubuntu-latest - needs: build - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: https://registry.npmjs.org - cache: npm - cache-dependency-path: typescript/package-lock.json - - - uses: actions/download-artifact@v4 - with: - path: dist - - - run: find dist - - - run: npm ci - working-directory: typescript - - - run: npm run lint:ci - working-directory: typescript - - - run: npm run generate - working-directory: typescript - - - run: npm run publish - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - working-directory: typescript - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - - dependabot: - name: Dependabot - runs-on: ubuntu-latest - permissions: - pull-requests: write - if: github.event.pull_request.user.login == 'dependabot[bot]' - steps: - - name: Automatically approve dependabot PRs - uses: octokit/request-action@v2.x - with: - route: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews - owner: ${{ github.event.repository.owner.login }} - repo: ${{ github.event.repository.name }} - pull_number: ${{ github.event.pull_request.number }} - event: APPROVE - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Login to Docker Hub + # uses: docker/login-action@v3 + # if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + # + # - name: Login to GitHub Container Registry + # uses: docker/login-action@v3 + # if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + # + # - name: Generate Docker image tags + # id: meta + # uses: docker/metadata-action@v5 + # if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} + # with: + # images: | + # ${{ github.repository }} + # ghcr.io/${{ github.repository }} + # tags: | + # type=ref,event=branch + # type=semver,pattern={{version}} + # type=semver,pattern={{major}}.{{minor}} + # type=semver,pattern={{major}} + # + # - name: Publish Docker image + # uses: docker/build-push-action@v6 + # if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} + # with: + # context: . + # target: release + # platforms: linux/amd64,linux/arm64 + # push: true + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + + # npm: + # name: NPM + # runs-on: ubuntu-latest + # needs: build + # + # steps: + # - uses: actions/checkout@v4 + # + # - uses: actions/setup-node@v4 + # with: + # node-version: 20 + # registry-url: https://registry.npmjs.org + # cache: npm + # cache-dependency-path: typescript/package-lock.json + # + # - uses: actions/download-artifact@v4 + # with: + # path: dist + # + # - run: find dist + # + # - run: npm ci + # working-directory: typescript + # + # - run: npm run lint:ci + # working-directory: typescript + # + # - run: npm run generate + # working-directory: typescript + # + # - run: npm run publish + # if: ${{ startsWith(github.ref, 'refs/tags/v') }} + # working-directory: typescript + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + + # dependabot: + # name: Dependabot + # runs-on: ubuntu-latest + # permissions: + # pull-requests: write + # if: github.event.pull_request.user.login == 'dependabot[bot]' + # steps: + # - name: Automatically approve dependabot PRs + # uses: octokit/request-action@v2.x + # with: + # route: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews + # owner: ${{ github.event.repository.owner.login }} + # repo: ${{ github.event.repository.name }} + # pull_number: ${{ github.event.pull_request.number }} + # event: APPROVE + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 2f56e530..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Release - -on: - push: - tags: ["v*"] - -jobs: - homebrew: - name: Bump Homebrew formula - runs-on: ubuntu-latest - steps: - - uses: mislav/bump-homebrew-formula-action@v3 - with: - formula-name: dbmate - env: - COMMITTER_TOKEN: ${{ secrets.RELEASE_TOKEN }}