diff --git a/.github/workflows/example-velocity-analysis.yml b/.github/workflows/example-velocity-analysis.yml index b314b9a..f07f816 100644 --- a/.github/workflows/example-velocity-analysis.yml +++ b/.github/workflows/example-velocity-analysis.yml @@ -10,7 +10,7 @@ jobs: analyze: runs-on: ubuntu-latest permissions: - contents: read + contents: write pages: write id-token: write @@ -19,11 +19,22 @@ jobs: uses: actions/checkout@v4 - name: Run Git Velocity Analysis - uses: lukaszraczylo/git-velocity/.github/actions/git-velocity@main + uses: lukaszraczylo/git-velocity@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} config_file: '.git-velocity.yaml' output_dir: './dist' - deploy_gh_pages: 'true' - upload_artifact: 'true' - artifact_name: 'velocity-dashboard' + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: velocity-dashboard + path: ./dist + retention-days: 30 + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist + force_orphan: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71b5aa6..513fa64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,14 @@ -name: Release +name: Test, build, release on: + workflow_dispatch: push: - tags: - - 'v*' + paths-ignore: + - '**.md' + - '**/release.yml' + - 'action.yml' + branches: + - main permissions: contents: write @@ -11,42 +16,9 @@ permissions: jobs: release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.23' - cache: true - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Build Vue SPA - working-directory: web - run: | - npm ci - npm run build - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + uses: lukaszraczylo/shared-actions/.github/workflows/go-release.yaml@main + with: + go-version: "1.24" + docker-enabled: true + rolling-release-tag: "v1" + secrets: inherit diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 000018b..516adf0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -69,24 +69,21 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - dockerfile: Dockerfile + dockerfile: Dockerfile.goreleaser extra_files: - config.example.yaml -homebrew_casks: +brews: - name: git-velocity repository: owner: lukaszraczylo - name: homebrew-taps + name: homebrew-tap token: "{{ .Env.HOMEBREW_TAP_TOKEN }}" - directory: Casks + directory: Formula homepage: https://github.com/lukaszraczylo/git-velocity description: "Developer velocity metrics analyzer with gamification dashboards" license: MIT - hooks: - post: - install: | - if OS.mac? - system_command "/usr/bin/xattr", - args: ["-dr", "com.apple.quarantine", "#{staged_path}/git-velocity"] - end + install: | + bin.install "git-velocity" + test: | + system "#{bin}/git-velocity", "version" diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser new file mode 100644 index 0000000..0e64d79 --- /dev/null +++ b/Dockerfile.goreleaser @@ -0,0 +1,14 @@ +FROM alpine:3.21 +ARG TARGETPLATFORM + +RUN apk add --no-cache ca-certificates tzdata git + +COPY ${TARGETPLATFORM}/git-velocity /usr/local/bin/git-velocity +COPY config.example.yaml /etc/git-velocity/config.example.yaml + +RUN chmod +x /usr/local/bin/git-velocity + +WORKDIR /workspace + +ENTRYPOINT ["/usr/local/bin/git-velocity"] +CMD ["--help"] diff --git a/README.md b/README.md index 00f88f9..26a0a0e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-
+