Skip to content

Commit

Permalink
chore(workflows): setup release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayhardaha committed Jun 25, 2024
1 parent 63af5c7 commit f42abdd
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get Tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Build the project
run: npm run build

- name: Zip the dist folder
run: zip -r dist.zip dist/

- name: Find files to upload
id: find_files
run: |
files=$(find . -type f \( -name "*.txt" -o -name "*.json" -o -name "*.md" -o -name "*.csv" \))
echo "files=$files" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: |
dist.zip
${{ env.files }}
token: ${{ env.GITHUB_TOKEN }}
tag: ${{ github.ref }}
name: ${{ env.tag }}
draft: false
prerelease: false

0 comments on commit f42abdd

Please sign in to comment.