Skip to content

Commit

Permalink
Adding Custom Release model for Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Malusev <[email protected]>
  • Loading branch information
Dusan Malusev committed Apr 30, 2021
1 parent dd1af94 commit 8fbcb2b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
48 changes: 40 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
binary:
unix:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: release
steps:
Expand All @@ -49,12 +49,44 @@ jobs:
- name: Test
run: make test RACE=1 ENVIRONMENT=production
- name: Build
run: |
if ["${{ matrix.os }}" = windows-latest]; then
make build VERSION=${{ steps.git_tag.outputs.tag }} RACE=0 ENVIRONMENT=production EXT=.exe;
else
make build VERSION=${{ steps.git_tag.outputs.tag }} RACE=0 ENVIRONMENT=production;
fi
run: make build VERSION=${{ steps.git_tag.outputs.tag }} RACE=0 ENVIRONMENT=production
env:
CGO_ENABLED: 0
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./bin/hosts
asset_name: hosts-${{ matrix.os }}-${{ steps.git_tag.outputs.tag }}
asset_content_type: application/octet-stream
windows:
runs-on: windows-latest
needs: release
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: olegtarasov/[email protected]
id: git_tag
with:
tagRegex: 'v(.*)'
tagRegexGroup: 1
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: make test RACE=1 ENVIRONMENT=production
- name: Build
run: make build VERSION=${{ steps.git_tag.outputs.tag }} RACE=0 ENVIRONMENT=production EXT=.exe
env:
CGO_ENABLED: 0
- name: Upload Release Asset
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This program is designed for developers to help them manage host files, which th

# Installation

1. Download from [Releases page](https://github.com/BrosSquad/hosts/releases/tag/v2.0.3).
1. Download from [Releases page](https://github.com/BrosSquad/hosts/releases/tag/v2.0.4).


2. Building from Source
Expand All @@ -20,7 +20,7 @@ This program is designed for developers to help them manage host files, which th

```sh
$ git clone https://github.com/BrosSquad/hosts.git hosts && cd hosts
$ git checkout tags/v2.0.3 -b v2.0.3
$ git checkout tags/v2.0.4 -b v2.0.4
$ make build VERSION=2.0.3 ENVIRONMENT=production RACE=0
$ make install
```
Expand Down

0 comments on commit 8fbcb2b

Please sign in to comment.