Skip to content

Commit

Permalink
Release embedded assets
Browse files Browse the repository at this point in the history
Signed-off-by: Breezewish <me@breeswish.org>
  • Loading branch information
breezewish committed Jan 6, 2020
1 parent 2ff28c1 commit 7ca0cc3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/release-ui-assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: actions/setup-go@v1
with:
go-version: '1.13.5'
- name: Lookup yarn cache
id: yarn_cache
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand All @@ -24,24 +27,19 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
working-directory: ui
run: |
yarn install --frozen-lockfile
- name: Build project
working-directory: ui
- name: Build UI
run: |
yarn build
- name: Pack release assets
make ui_for_pd
- name: Pack UI asset release
working-directory: ui/build
run: |
zip -r ../static-assets.zip .
- name: Lookup release version
- name: Lookup asset release version
id: lookup_release_version
working-directory: ui
run: |
echo "::set-output name=release_version::$(grep -v '^#' .github_release_version)"
- name: Create release
- name: Create asset release
id: create_release
uses: actions/create-release@v1
env:
Expand All @@ -51,7 +49,7 @@ jobs:
release_name: UI Release ${{ steps.lookup_release_version.outputs.release_version }}
draft: false
prerelease: false
- name: Upload release assets
- name: Upload asset release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -60,3 +58,19 @@ jobs:
asset_path: ./ui/static-assets.zip
asset_name: static-assets.zip
asset_content_type: application/zip
- name: Generate embedded assets
run: |
scripts/embed_ui_assets.sh
cp pkg/uiserver/embedded_assets_handler.go embedded_assets_handler.go
- name: Pack embedded assets
run: |
zip -r embedded-assets-golang.zip ./embedded_assets_handler.go
- name: Upload embedded asset release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./embedded-assets-golang.zip
asset_name: embedded-assets-golang.zip
asset_content_type: application/zip
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@ default:
tidy:
go mod tidy

swagger:
scripts/generate_swagger.sh
swagger_spec:
scripts/generate_swagger_spec.sh

swagger_client: swagger
cd ui && yarn && npm run build_api_client
yarn_dependencies:
cd ui && yarn install --frozen-lockfile

swagger_client: swagger_spec yarn_dependencies
cd ui && npm run build_api_client

ui: swagger_client
cd ui && yarn && REACT_APP_DASHBOARD_API_URL="" npm run build
cd ui && REACT_APP_DASHBOARD_API_URL="" npm run build

ui_for_pd: swagger_client
cd ui && REACT_APP_DASHBOARD_API_URL="/dashboard" npm run build

server:
ifeq ($(SWAGGER),1)
make swagger
make swagger_spec
endif
ifeq ($(UI),1)
scripts/embed_ui_assets.sh
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ui/.github_release_version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file contains a version number which will be used to release assets to
# GitHub. To trigger a new asset release, simply increase this version number.
20200103_1
20200106_1

0 comments on commit 7ca0cc3

Please sign in to comment.