-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release with github actions (and arm builds)
- Loading branch information
Showing
6 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
tags: | ||
- '*.*.*' | ||
- '*.*.*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
smtp_to_telegram | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
project_name: smtp_to_telegram | ||
|
||
release: | ||
prerelease: auto | ||
|
||
builds: | ||
- id: smtp_to_telegram | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- windows | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
goarm: | ||
- '7' | ||
ldflags: | ||
- -s -w -X main.Version={{.Version}} | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
dockers: | ||
- &xdocker | ||
image_templates: | ||
- kostyaesmukov/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
dockerfile: Dockerfile.release | ||
use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
build_flag_templates: | ||
- --platform=linux/amd64 | ||
|
||
- <<: *xdocker | ||
image_templates: | ||
- kostyaesmukov/{{ .ProjectName }}:{{ .Version }}-arm64 | ||
goarch: arm64 | ||
build_flag_templates: | ||
- --platform=linux/arm64/v8 | ||
|
||
- <<: *xdocker | ||
image_templates: | ||
- kostyaesmukov/{{ .ProjectName }}:{{ .Version }}-armv7 | ||
goarch: arm | ||
goarm: 7 | ||
build_flag_templates: | ||
- --platform=linux/arm/v7 | ||
|
||
docker_manifests: | ||
- name_template: kostyaesmukov/{{ .ProjectName }}:latest | ||
image_templates: | ||
- kostyaesmukov/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- kostyaesmukov/{{ .ProjectName }}:{{ .Version }}-arm64 | ||
- kostyaesmukov/{{ .ProjectName }}:{{ .Version }}-armv7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM alpine:3.16 | ||
|
||
RUN apk add --no-cache ca-certificates mailcap | ||
|
||
COPY smtp_to_telegram /smtp_to_telegram | ||
|
||
USER daemon | ||
|
||
ENV ST_SMTP_LISTEN="0.0.0.0:2525" | ||
EXPOSE 2525 | ||
|
||
ENTRYPOINT ["/smtp_to_telegram"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
GOLANG_CROSS_VERSION ?= v1.18.1 | ||
|
||
test-release: | ||
@docker run \ | ||
--rm \ | ||
--privileged \ | ||
-v ${PWD}:/smtp_to_telegram \ | ||
-w /smtp_to_telegram \ | ||
-e GITHUB_TOKEN \ | ||
-e DOCKER_USERNAME \ | ||
-e DOCKER_PASSWORD \ | ||
-e DOCKER_REGISTRY \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | ||
--rm-dist --skip-validate --timeout=1h --snapshot |