-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yoram de Langen <[email protected]>
- Loading branch information
1 parent
886877f
commit e71e02e
Showing
1 changed file
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build and Release | ||
on: | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
build: | ||
name: Build and Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build project | ||
run: yarn build | ||
- name: Set release version | ||
id: set_version | ||
run: echo "::set-output name=version::$(echo ${{ github.ref }} | awk -F / '{print $NF}')" | ||
- name: Zip dist assets | ||
run: zip -r dist_${{ steps.set_version.outputs.version }}.zip dist | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Assets | ||
id: upload_release_assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dist_${{ steps.set_version.outputs.version }}.zip | ||
asset_name: dist_${{ steps.set_version.outputs.version }}.zip | ||
asset_content_type: application/zip |