Skip to content

Commit

Permalink
Merge pull request #161 from numary/goreleaser_optimization
Browse files Browse the repository at this point in the history
feat: Goreleaser optimization
  • Loading branch information
flemzord authored Feb 17, 2022
2 parents 2ba2d77 + c7f0b4c commit 73bacf3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 103 deletions.
67 changes: 0 additions & 67 deletions .github/.goreleaser.windows.yml

This file was deleted.

15 changes: 3 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ jobs:
name: 'Build'
needs:
- build_control
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
include:
- os: windows-latest
file: windows
- os: ubuntu-latest
file: default
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
Expand All @@ -59,20 +51,19 @@ jobs:
name: control-dist
path: cmd/control/
- name: OSXCross for CGO Support
if: matrix.os == 'ubuntu-latest'
run: |
mkdir ../../osxcross
git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- name: Downgrade libssl
if: matrix.os == 'ubuntu-latest'
run: |
echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list
sudo apt update && apt-cache policy libssl1.0-dev
sudo apt-get install libssl1.0-dev
- run: sudo apt install gcc-mingw-w64 -y
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --parallelism 4 --rm-dist --skip-validate --snapshot --config .github/.goreleaser.${{matrix.file}}.yml
args: build --parallelism 4 --rm-dist --skip-validate --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 3 additions & 12 deletions .github/workflows/pr_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,7 @@ jobs:
- Test_sqlite
- Test_postgres
- Lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
include:
- os: windows-latest
file: windows
- os: ubuntu-latest
file: default
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
Expand All @@ -155,21 +147,20 @@ jobs:
name: control-dist
path: cmd/control/
- name: OSXCross for CGO Support
if: matrix.os == 'ubuntu-latest'
run: |
mkdir ../../osxcross
git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- name: Downgrade libssl
if: matrix.os == 'ubuntu-latest'
run: |
echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list
sudo apt update && apt-cache policy libssl1.0-dev
sudo apt-get install libssl1.0-dev
- run: sudo apt install gcc-mingw-w64 -y
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --parallelism 4 --rm-dist --skip-validate --snapshot --config .github/.goreleaser.${{matrix.file}}.yml
args: build --parallelism 4 --rm-dist --skip-validate --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ jobs:
name: 'Build Binary'
needs:
- build_control
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
include:
- os: windows-latest
file: windows
- os: ubuntu-latest
file: default
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
Expand All @@ -55,24 +47,23 @@ jobs:
name: control-dist
path: cmd/control/
- name: OSXCross for CGO Support
if: matrix.os == 'ubuntu-latest'
run: |
mkdir ../../osxcross
git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- name: Downgrade libssl
if: matrix.os == 'ubuntu-latest'
run: |
echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list
sudo apt update && apt-cache policy libssl1.0-dev
sudo apt-get install libssl1.0-dev
- run: sudo apt install gcc-mingw-w64 -y
- name: Run GoReleaser
env:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --parallelism 4 --rm-dist --skip-validate --config .github/.goreleaser.${{matrix.file}}.yml
args: release --parallelism 4 --rm-dist --skip-validate
build_docker:
name: 'Build & Publish Docker'
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions .github/.goreleaser.default.yml → .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ before:
- go mod download

builds:
- binary: numary
id: numary_windows
ldflags:
- -X github.com/numary/ledger/cmd.BuildDate={{ .Date }}
- -X github.com/numary/ledger/cmd.Version={{ .Version }}
- -X github.com/numary/ledger/cmd.Commit={{ .ShortCommit }}
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
goos:
- windows
goarch:
- amd64
- binary: numary
id: numary_linux
ldflags:
Expand Down Expand Up @@ -42,6 +55,7 @@ archives:
builds:
- numary_linux
- numary_darwin
- numary_windows
format: tar.gz
format_overrides:
- goos: windows
Expand Down

0 comments on commit 73bacf3

Please sign in to comment.