From 35d53c8a58c8f9510d5d45f1916dae18e570fac4 Mon Sep 17 00:00:00 2001 From: Christian Ditaputratama Date: Tue, 29 Oct 2024 21:03:42 +0700 Subject: [PATCH] feat!: Update GitHub actions to work with templ and bun --- .github/dependabot.yml | 11 ----------- .github/workflows/build.yml | 21 ++++++++------------- .github/workflows/release.yml | 14 +++++++------- .github/workflows/test.yml | 24 ++++++++---------------- 4 files changed, 23 insertions(+), 47 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5d7518b..1444ccc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,14 +10,3 @@ updates: - ditatompel assignees: - ditatompel - - - package-ecosystem: "npm" - directory: "/frontend" - schedule: - interval: weekly - time: "05:00" - open-pull-requests-limit: 5 - reviewers: - - ditatompel - assignees: - - ditatompel diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d49f7c3..a145001 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,25 +14,20 @@ jobs: - name: Check out source code uses: actions/checkout@v4 - - name: setup NodeJS - uses: actions/setup-node@v4 - with: - node-version: "20" - registry-url: "https://registry.npmjs.org" - - - name: Cache node modules - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- + - name: Setup bun + uses: oven-sh/setup-bun@v2 - name: Setup Go uses: actions/setup-go@v5 with: go-version: 1.22.x + - name: Setup templ + run: go install github.com/a-h/templ/cmd/templ@v0.2.778 + + - name: Prepare assets + run: make prepare + - name: Cache Go modules uses: actions/cache@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f97865..886bcaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,20 +16,20 @@ jobs: - name: Check out source code uses: actions/checkout@v4 - - name: setup NodeJS - uses: actions/setup-node@v4 - with: - node-version: "20" - registry-url: "https://registry.npmjs.org" + - name: Setup bun + uses: oven-sh/setup-bun@v2 - name: Setup Go uses: actions/setup-go@v5 with: go-version: 1.22.x + - name: Setup templ + run: go install github.com/a-h/templ/cmd/templ@v0.2.778 + # Need to build the UI here before build the server binary with go-release-action - - name: Build UI - run: make ui + - name: Prepare assets + run: make prepare templ tailwind - name: Build server binary uses: wangyoucao577/go-release-action@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0abc54..3669880 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,11 +12,17 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 + - name: Setup bun + uses: oven-sh/setup-bun@v2 + - name: Setup Go uses: actions/setup-go@v5 with: go-version: 1.22.x + - name: Setup templ + run: go install github.com/a-h/templ/cmd/templ@v0.2.778 + - name: Cache Go modules uses: actions/cache@v3 with: @@ -25,22 +31,8 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: setup NodeJS - uses: actions/setup-node@v4 - with: - node-version: "20" - registry-url: "https://registry.npmjs.org" - - - name: Cache node modules - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Build UI - run: make ui + - name: Prepare assets + run: make prepare templ tailwind - name: Run lint uses: golangci/golangci-lint-action@v4