Create Draft Release #17
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
name: Create Draft Release | |
on: | |
workflow_dispatch: | |
jobs: | |
pack: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Pack the build | |
id: pack | |
run: | | |
npm pack --pack-dest=./dist | |
echo "TGZ_PATH=$(find ./dist -name 'dbpf-*.tgz')" >> $GITHUB_OUTPUT | |
- name: Create Release Draft | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name || 'manual-release' }} | |
release_name: ${{ github.ref_name || 'Manual Release' }} | |
draft: true | |
prerelease: false | |
body_path: ./README.md | |
- name: Upload webpack to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: './dist/dbpf.web.js' | |
asset_name: 'dbpf.web.js' | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload zip to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.pack.outputs.TGZ_PATH }} | |
asset_name: 'module.tgz' | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |