Skip to content

Commit

Permalink
Merge pull request #91 from Efreak/master
Browse files Browse the repository at this point in the history
create GitHub action
  • Loading branch information
anacrolix authored Feb 22, 2022
2 parents 50fb83b + d0abfd6 commit c3dd06e
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
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

0 comments on commit c3dd06e

Please sign in to comment.