Skip to content

Commit

Permalink
v2 (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam authored Nov 2, 2024
1 parent 6a5627b commit 2e0b0d2
Show file tree
Hide file tree
Showing 242 changed files with 14,805 additions and 13,255 deletions.
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
"name": "default",
"image": "golang:1.23-bookworm",
"features": {
"ghcr.io/guiyomh/features/golangci-lint:0": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/sshd:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker"
]
}
},
"postCreateCommand": "go mod download"
}
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[{*.yml,*.yaml}]
ij_any_spaces_within_braces = false
ij_any_spaces_within_brackets = false

[{Makefile,go.mod,*.go}]
indent_style = tab
29 changes: 0 additions & 29 deletions .env.example

This file was deleted.

10 changes: 0 additions & 10 deletions .gitattributes

This file was deleted.

25 changes: 12 additions & 13 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,28 @@
version: 2

updates:
- package-ecosystem: gomod
- package-ecosystem: github-actions
directory: /
groups: {gomod: {patterns: ['*'], exclude-patterns: ['github.com/gorilla/websocket']}}
schedule: {interval: monthly}
groups: {github-actions: {patterns: ['*']}}
assignees: [tarampampam]

- package-ecosystem: npm
directory: /web
open-pull-requests-limit: 15
groups:
npm-production: {dependency-type: production, update-types: [minor, patch]}
npm-development: {dependency-type: development, update-types: [minor, patch]}
- package-ecosystem: docker
directory: /
schedule: {interval: monthly}
groups: {docker: {patterns: ['*']}}
assignees: [tarampampam]

- package-ecosystem: github-actions
- package-ecosystem: gomod
directory: /
groups: {github-actions: {patterns: ['*']}}
schedule: {interval: monthly}
groups: {gomod: {patterns: ['*']}}
assignees: [tarampampam]

- package-ecosystem: docker
directory: /
groups: {docker: {patterns: ['*']}}
- package-ecosystem: npm
directory: /web
schedule: {interval: monthly}
groups:
npm-production: {dependency-type: production, update-types: [minor, patch]}
npm-development: {dependency-type: development, update-types: [minor, patch]}
assignees: [tarampampam]
13 changes: 0 additions & 13 deletions .github/release.yml

This file was deleted.

62 changes: 35 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@
name: 🚀 Release

on:
release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release>
types: [published]
release: {types: [published]}
workflow_dispatch: {}

jobs:
build-app:
name: 🏗️ Build the app (${{ matrix.os }} / ${{ matrix.arch }})
name: Build for ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [linux, windows, darwin]
arch: [amd64]
os: [linux, darwin, windows]
arch: [amd64, arm64]
env: {FORCE_COLOR: 'true', NPM_PREFIX: './web'}
steps:
- uses: actions/checkout@v4
- {uses: actions/setup-node@v4, with: {node-version: 22, cache: 'npm', cache-dependency-path: web/package-lock.json}}
- {working-directory: ./web, run: npm ci --no-audit && npm run generate}
- {working-directory: ./web, run: npm run build}
- {uses: gacts/setup-go-with-cache@v1, with: {go-version-file: go.mod}}
- run: |
go install "github.com/deepmap/oapi-codegen/v2/cmd/[email protected]"
go generate ./...
- {uses: gacts/github-slug@v1, id: slug}
- id: values
run: echo "binary-name=webhook-tester-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT
# build the frontend
- uses: actions/setup-node@v4
with: {node-version: 22, cache: 'npm', cache-dependency-path: ./web/package-lock.json}
- run: npm --prefix "$NPM_PREFIX" install --no-audit
- run: npm --prefix "$NPM_PREFIX" run generate
- run: npm --prefix "$NPM_PREFIX" run build
# build the backend
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
- run: go install "github.com/oapi-codegen/oapi-codegen/v2/cmd/[email protected]"
- run: go generate -skip readme ./...
- env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
LDFLAGS: -s -w -X gh.tarampamp.am/webhook-tester/internal/version.version=${{ steps.slug.outputs.version }}
run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/webhook-tester/
LDFLAGS: -s -w -X gh.tarampamp.am/webhook-tester/v2/internal/version.version=${{ steps.slug.outputs.version }}
run: go build -trimpath -ldflags "$LDFLAGS" -o ./${{ steps.values.outputs.binary-name }} ./cmd/webhook-tester/
# upload the binary
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -42,30 +47,33 @@ jobs:
tag: ${{ github.ref }}

build-docker-image:
name: 🏗️ Build the docker image
name: Build the docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- {uses: gacts/github-slug@v1, id: slug}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- {uses: gacts/github-slug@v1, id: slug}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
build-args: "APP_VERSION=${{ steps.slug.outputs.version }}"
tags: |
tarampampam/webhook-tester:${{ steps.slug.outputs.version }}
tarampampam/webhook-tester:latest
tags: | # TODO: add `ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest` and `docker.io/tarampampam/webhook-tester:latest`
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }}
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}
docker.io/tarampampam/webhook-tester:${{ steps.slug.outputs.version }}
docker.io/tarampampam/webhook-tester:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
docker.io/tarampampam/webhook-tester:${{ steps.slug.outputs.version-major }}
Loading

0 comments on commit 2e0b0d2

Please sign in to comment.