env VERSION

pull/508/head
hunterlong 2020-04-17 06:35:56 -07:00
parent 9636f058de
commit 4d8fae354a
1 changed files with 22 additions and 13 deletions

View File

@ -16,7 +16,9 @@ jobs:
go-version: '1.14.x' go-version: '1.14.x'
- name: Add GOBIN to PATH - name: Add GOBIN to PATH
run: echo "::add-path::$(go env GOPATH)/bin" run: |
echo "::add-path::$(go env GOPATH)/bin"
echo ::set-env name=VERSION::$(cat version.txt)
shell: bash shell: bash
- name: Install Node - name: Install Node
@ -81,8 +83,10 @@ jobs:
with: with:
go-version: '1.14.x' go-version: '1.14.x'
- name: Add GOBIN to PATH - name: Setting ENV's
run: echo "::add-path::$(go env GOPATH)/bin" run: |
echo "::add-path::$(go env GOPATH)/bin"
echo ::set-env name=VERSION::$(cat version.txt)
shell: bash shell: bash
- name: Install Node - name: Install Node
@ -117,6 +121,8 @@ jobs:
path: /home/runner/work/statping/statping/source/dist path: /home/runner/work/statping/statping/source/dist
- name: Install Statping - name: Install Statping
env:
VERSION: $VERSION
run: | run: |
make build make build
chmod +x statping chmod +x statping
@ -125,12 +131,12 @@ jobs:
- name: Go Tests - name: Go Tests
run: SASS=`which sass` go test -v -covermode=count -coverprofile=coverage.out -p=1 ./... run: SASS=`which sass` go test -v -covermode=count -coverprofile=coverage.out -p=1 ./...
env: env:
VERSION: $VERSION
DB_CONN: sqlite3 DB_CONN: sqlite3
STATPING_DIR: /home/runner/work/statping/statping STATPING_DIR: /home/runner/work/statping/statping
API_KEY: demopassword123 API_KEY: demopassword123
DISABLE_LOGS: true DISABLE_LOGS: true
ALLOW_REPORTS: true ALLOW_REPORTS: true
VERSION: $(cat version.txt)
COVERALLS: ${{ secrets.COVERALLS }} COVERALLS: ${{ secrets.COVERALLS }}
DISCORD_URL: ${{ secrets.DISCORD_URL }} DISCORD_URL: ${{ secrets.DISCORD_URL }}
EMAIL_HOST: ${{ secrets.EMAIL_HOST }} EMAIL_HOST: ${{ secrets.EMAIL_HOST }}
@ -178,8 +184,10 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-go- ${{ runner.os }}-go-
- name: Add GOBIN to PATH - name: Setting ENV's
run: echo "::add-path::$(go env GOPATH)/bin" run: |
echo "::add-path::$(go env GOPATH)/bin"
echo ::set-env name=VERSION::$(cat version.txt)
shell: bash shell: bash
- name: Download Compiled Frontend - name: Download Compiled Frontend
@ -190,7 +198,7 @@ jobs:
- name: Build Binaries - name: Build Binaries
env: env:
VERSION: $(cat version.txt) VERSION: $VERSION
COMMIT: $GITHUB_SHA COMMIT: $GITHUB_SHA
run: make build-bin build-win run: make build-bin build-win
@ -199,11 +207,11 @@ jobs:
uses: actions/create-release@latest uses: actions/create-release@latest
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: $(cat version.txt) VERSION: $VERSION
with: with:
tag_name: v$(cat version.txt) tag_name: v$VERSION
release_name: Statping v$(cat version.txt) release_name: Statping v$VERSION
body: Version v$(cat version.txt) body: Version v$VERSION
draft: false draft: false
prerelease: false prerelease: false
@ -212,6 +220,7 @@ jobs:
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: $VERSION
with: 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 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: | pattern: |
@ -240,7 +249,7 @@ jobs:
SENTRY_ORG: statping SENTRY_ORG: statping
SENTRY_PROJECT: backend SENTRY_PROJECT: backend
with: with:
tagName: v$(cat version.txt) tagName: v$VERSION
environment: production environment: production
- name: Sentry Frontend Release - name: Sentry Frontend Release
@ -251,5 +260,5 @@ jobs:
SENTRY_ORG: statping SENTRY_ORG: statping
SENTRY_PROJECT: frontend SENTRY_PROJECT: frontend
with: with:
tagName: v$(cat version.txt) tagName: v$VERSION
environment: production environment: production