Skip to content

Commit

Permalink
github action to build each version on arch vm
Browse files Browse the repository at this point in the history
  • Loading branch information
samyfodil committed Apr 30, 2024
1 parent 86c4b03 commit d730c99
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 157 deletions.
73 changes: 16 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,35 @@
on:
push:
# run only against tags
tags:
- '*'

jobs:
linux:
runs-on: ubuntu-latest
release:
strategy:
matrix:
include:
- os: ubuntu-latest
config: '.goreleaser.linux.yml'
- os: macos-latest
config: '.goreleaser.darwin.yml'
- os: windows-latest
config: '.goreleaser.windows.yml'
runs-on: ${{ matrix.os }}
steps:
-
name: Checkout
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean --config .goreleaser.yml --id linux
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}

mac:
runs-on: macos-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean --config .goreleaser.yml --id darwin
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}


windows:
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean --config .goreleaser.yml --id windows
args: release --config ${{ matrix.config }}
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .goreleaser.darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
release:
# Repo in which the release will be created.
github:
owner: taubyte
name: dreamland

# Control the draft and prerelease settings
draft: false
replace_existing_draft: false
prerelease: auto

# Release naming and SCM interaction
name_template: ""
disable: false
skip_upload: false

builds:
- id: "darwin"
main: "main.go"
binary: "dreamland"
goos:
- darwin
goarch:
- arm64
- amd64
env:
- CGO_ENABLED=1
flags:
- -trimpath
tags:
- darwin
- odo


changelog:
skip: true

checksum:
disable: true

archives:
- files:
- none*
39 changes: 39 additions & 0 deletions .goreleaser.linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
release:
# Repo in which the release will be created.
github:
owner: taubyte
name: dreamland

# Control the draft and prerelease settings
draft: false
replace_existing_draft: false
prerelease: auto

# Release naming and SCM interaction
name_template: ""
disable: false
skip_upload: false

builds:
- id: "linux"
main: "main.go"
binary: "dreamland"
goos:
- linux
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=0
- GOAMD64=v2


changelog:
skip: true

checksum:
disable: true

archives:
- files:
- none*
40 changes: 40 additions & 0 deletions .goreleaser.windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
release:
# Repo in which the release will be created.
github:
owner: taubyte
name: dreamland

# Control the draft and prerelease settings
draft: false
replace_existing_draft: false
prerelease: auto

# Release naming and SCM interaction
name_template: ""
disable: false
skip_upload: false

builds:
- id: "windows"
main: "main.go"
binary: "dreamland.exe"
goos:
- windows
goarch:
- amd64
env:
- CGO_ENABLED=0
- GOAMD64=v2
tags:
- windows


changelog:
skip: true

checksum:
disable: true

archives:
- files:
- none*
100 changes: 0 additions & 100 deletions .goreleaser.yml

This file was deleted.

0 comments on commit d730c99

Please sign in to comment.