Skip to content

Build And Release

Build And Release #1

Workflow file for this run

name: Build And Release
on:
workflow_dispatch:
inputs:
version:
description: 'The Pack Version'
required: true
default: '1.0.0'
type: string
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
Pack-Release:
runs-on: ubuntu-latest
steps:
- name: Create Pack
uses: actions/checkout@v3
- name: node index
env:
PACK_VERSION: ${{ inputs.version }}
PACK_NAME: ${{ vars.PACK_NAME }}
REPO_LINK: ${{github.repository}}
run: |
npm i
node index
- name: Get release notes
id: read_release_body
run: |
content=$(cat content.md)
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
echo "$content" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
release_name: Release ${{ inputs.version }}
body: ${{ env.RELEASE_BODY }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACK_VERSION: ${{ inputs.version }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pack.zip
asset_name: pack.zip
asset_content_type: application/zip