Skip to content

fix: workflow

fix: workflow #6

name: Build and Release
on:
push:
tags:
- 'v*.*.*' # This triggers the workflow on version tags (e.g., v1.0.0)
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build
- name: Prepare zip folder
run: |
mkdir cidgravitygateway
rsync -av --progress . ./cidgravitygateway --exclude node_modules --exclude .git --exclude cidgravitygateway
- name: Archive the artifacts
run: |
cd cidgravitygateway
zip -r ../project-build.zip .
cd ..
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./project-build.zip
asset_name: project-build.zip
asset_content_type: application/zip