Skip to content

Commit

Permalink
added release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Yoram de Langen <[email protected]>
  • Loading branch information
yoramdelangen committed May 24, 2023
1 parent 886877f commit e71e02e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yaml
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

0 comments on commit e71e02e

Please sign in to comment.