Skip to content

Commit

Permalink
Added goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
shahariaazam committed Sep 1, 2024
1 parent 49de747 commit a6401b8
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 20 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-go@v3
with:
go-version: '^1.22'

- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: goreleaser/goreleaser-action@v6
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/test-action.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
version: 2
project_name: oauth-mock-server
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
dockers:
- image_templates: ["ghcr.io/shaharia-lab/oauth-mock-server:{{ .Version }}"]
dockerfile: goreleaser.dockerfile
build_flag_templates:
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/shaharia-lab/oauth-mock-server
- --label=org.opencontainers.image.source=https://github.com/shaharia-lab/oauth-mock-server
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
nfpms:
- maintainer: Shaharia Lab OÜ <hello@shaharialab.com>
description: Setup and run an OAuth mock server for testing purposes
homepage: https://github.com/shaharia-lab/oauth-mock-server
license: MIT
formats:
- deb
- rpm
- apk
4 changes: 4 additions & 0 deletions goreleaser.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This dockerfile is only used to build the backend image for the application using goreleaser.
FROM alpine:3.12
COPY oauth-mock-server /app/oauth-mock-server
ENTRYPOINT ["/app/oauth-mock-server"]

0 comments on commit a6401b8

Please sign in to comment.