Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create GitHub action #91

Merged
merged 4 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .goreleaser.yaml
builds:
# You can have multiple builds defined as a yaml list
-
# ID of the build.
# Defaults to the project name.
id: "my-build"

# Optionally override the matrix generation and specify only the final list of targets.
# Format is `{goos}_{goarch}` with optionally a suffix with `_{goarm}` or `_{gomips}`.
# This overrides `goos`, `goarch`, `goarm`, `gomips` and `ignores`.
targets:
- linux_amd64
- linux_386
- linux_arm_6
- linux_arm_7
- darwin_arm64
- darwin_amd64
- windows_arm
- windows_amd64
- windows_386

# By default, GoRelaser will create your binaries inside `dist/${BuildID}_${BuildTarget}`, which is an unique directory per build target in the matrix.
# You are able to set subdirs within that folder using the `binary` property.
#
# However, if for some reason you don't want that unique directory to be created, you can set this property.
# If you do, you are responsible of keeping different builds from overriding each other.
#
# Defaults to `false`.
#no_unique_dist_dir: true
89 changes: 89 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: goreleaser

on:
pull_request:
push:

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist --config ${{ github.workspace }}/.github/goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
-
name: Upload artifact dms_linux_amd64
uses: actions/upload-artifact@v2
with:
name: dms_linux_amd64
path: dist/my-build_linux_amd64/dms
-
name: Upload artifact dms_linux_386
uses: actions/upload-artifact@v2
with:
name: dms_linux_386
path: dist/my-build_linux_386/dms
-
name: Upload artifact dms_linux_arm_6
uses: actions/upload-artifact@v2
with:
name: dms_linux_arm_6
path: dist/my-build_linux_arm_6/dms
-
name: Upload artifact dms_linux_arm_7
uses: actions/upload-artifact@v2
with:
name: dms_linux_arm_7
path: dist/my-build_linux_arm_7/dms
-
name: Upload artifact dms_darwin_arm64
uses: actions/upload-artifact@v2
with:
name: dms_darwin_arm64
path: dist/my-build_darwin_arm64/dms
-
name: Upload artifact dms_darwin_amd64
uses: actions/upload-artifact@v2
with:
name: dms_darwin_amd64
path: dist/my-build_darwin_amd64/dms
-
name: Upload artifact dms_windows_arm.exe
uses: actions/upload-artifact@v2
with:
name: dms_windows_arm
path: dist/my-build_windows_arm/dms.exe
-
name: Upload artifact dms_windows_amd64.exe
uses: actions/upload-artifact@v2
with:
name: dms_windows_amd64
path: dist/my-build_windows_amd64/dms.exe
-
name: Upload artifact dms_windows_386.exe
uses: actions/upload-artifact@v2
with:
name: dms_windows_386
path: dist/my-build_windows_386/dms.exe