-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use gorelease to publish new version
- Loading branch information
Svetlin Ralchev
committed
Dec 13, 2019
1 parent
e89cc24
commit 0241c6b
Showing
4 changed files
with
41 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,72 +2,25 @@ name: release | |
|
||
on: | ||
push: | ||
branches: | ||
- "!*" | ||
tags: | ||
- 'v*' | ||
- "v*.*.*" | ||
|
||
jobs: | ||
pipeline: | ||
name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Set up environment | ||
run: echo ::set-env name=VERSION_NUMBER::$(echo ${GITHUB_REF:10}) | ||
- name: Check out Code | ||
uses: actions/checkout@v1 | ||
- name: Set up Golang | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: '1.13.x' | ||
- name: Install Golang tools | ||
run: go install github.com/mitchellh/gox | ||
- name: Build release | ||
run: $HOME/go/bin/gox -ldflags "-X main.Version=$VERSION_NUMBER" --output="$GOX_OUTPUT" --osarch="$GOX_OSARCH" github.com/$GITHUB_REPOSITORY/cmd/prana | ||
env: | ||
GOX_OUTPUT: "./build/{{.OS}}/{{.Dir}}_{{.OS}}_{{.Arch}}" | ||
GOX_OSARCH: "linux/amd64 linux/386 darwin/amd64 darwin/386 windows/386 windows/amd64" | ||
- name: Bundle Linux release | ||
run: zip --junk-paths prana-linux-${{ env.VERSION_NUMBER }}.zip ./build/linux/* | ||
- name: Bundle Darwin release | ||
run: zip --junk-paths prana-darwin-${{ env.VERSION_NUMBER }}.zip ./build/darwin/* | ||
- name: Bundle Windows release | ||
run: zip --junk-paths prana-windows-${{ env.VERSION_NUMBER }}.zip ./build/windows/* | ||
- name: Create release | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Linux release | ||
id: upload_release_linux | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Release Application | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./prana-linux-${{ env.VERSION_NUMBER }}.zip | ||
asset_name: prana-linux-${{ env.VERSION_NUMBER }}.zip | ||
asset_content_type: application/zip | ||
- name: Upload Darwin release | ||
id: upload_release_darwin | ||
uses: actions/[email protected] | ||
version: latest | ||
args: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./prana-darwin-${{ env.VERSION_NUMBER }}.zip | ||
asset_name: prana-darwin-${{ env.VERSION_NUMBER }}.zip | ||
asset_content_type: application/zip | ||
- name: Upload Windows release | ||
id: upload_release_windows | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./prana-windows-${{ env.VERSION_NUMBER }}.zip | ||
asset_name: prana-windows-${{ env.VERSION_NUMBER }}.zip | ||
asset_content_type: application/zip | ||
GITHUB_TOKEN: ${{ secrets.GORELEASE_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
builds: | ||
- main: ./cmd/prana/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
brews: | ||
- github: | ||
owner: phogolabs | ||
name: homebrew-tap | ||
name: prana | ||
description: Golang Database Management and Code Generation | ||
homepage: https://github.com/phogolabs/prana | ||
test: | | ||
system "#{bin}/prana -v" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters