Skip to content

Commit

Permalink
GH releases
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterlong committed Apr 17, 2020
1 parent 4d8fae3 commit edb7306
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:

- name: Install Statping
env:
VERSION: $VERSION
VERSION: ${{ env.VERSION }}
run: |
make build
chmod +x statping
Expand All @@ -131,7 +131,7 @@ jobs:
- name: Go Tests
run: SASS=`which sass` go test -v -covermode=count -coverprofile=coverage.out -p=1 ./...
env:
VERSION: $VERSION
VERSION: ${{ env.VERSION }}
DB_CONN: sqlite3
STATPING_DIR: /home/runner/work/statping/statping
API_KEY: demopassword123
Expand Down Expand Up @@ -198,34 +198,37 @@ jobs:

- name: Build Binaries
env:
VERSION: $VERSION
VERSION: ${{ env.VERSION }}
COMMIT: $GITHUB_SHA
run: make build-bin build-win

- name: Create Release
id: create_release
uses: actions/create-release@latest
- name: Upload Release
id: upload-release-asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: $VERSION
VERSION: ${{ env.VERSION }}
with:
tag_name: v$VERSION
release_name: Statping v$VERSION
body: Version v$VERSION
tag_name: v${{ env.VERSION }}
draft: false
prerelease: false

- name: Upload Release Binaries
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: $VERSION
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
pattern: |
"build/*.tar.gz"
"build/*.zip"
files: |
build/statping-darwin-386.tar.gz
build/statping-darwin-amd64.tar.gz
build/statping-freebsd-386.tar.gz
build/statping-freebsd-amd64.tar.gz
build/statping-freebsd-arm.tar.gz
build/statping-linux-386.tar.gz
build/statping-linux-amd64.tar.gz
build/statping-linux-arm.tar.gz
build/statping-linux-arm64.tar.gz
build/statping-openbsd-386.tar.gz
build/statping-openbsd-amd64.tar.gz
build/statping-openbsd-arm.tar.gz
build/statping-openbsd-arm64.tar.gz
build/statping-windows-386.zip
build/statping-windows-amd64.zip
build/statping-windows-arm.zip
post-release:
needs: build
Expand All @@ -249,7 +252,7 @@ jobs:
SENTRY_ORG: statping
SENTRY_PROJECT: backend
with:
tagName: v$VERSION
tagName: v${{ env.VERSION }}
environment: production

- name: Sentry Frontend Release
Expand All @@ -260,5 +263,5 @@ jobs:
SENTRY_ORG: statping
SENTRY_PROJECT: frontend
with:
tagName: v$VERSION
tagName: v${{ env.VERSION }}
environment: production
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ build-bin:
do \
for os in $(OS);\
do \
echo "Building $$os-$$arch"; \
echo "Building $$VERSION $$os-$$arch"; \
mkdir -p releases/statping-$$os-$$arch/; \
GO111MODULE="on" GOOS=$$os GOARCH=$$arch go build -a -ldflags "-X main.VERSION=${VERSION} -X main.COMMIT=$(TRAVIS_COMMIT)" -o releases/statping-$$os-$$arch/statping ${PWD}/cmd; \
chmod +x releases/statping-$$os-$$arch/statping; \
Expand Down

0 comments on commit edb7306

Please sign in to comment.