-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Actions workflow for creating release
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Create release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
- name: Obtain version information | ||
id: version | ||
run: | | ||
version=$(npm run env | grep 'npm_package_version=' | cut -d= -f2) | ||
echo "::set-output name=version::${version}" | ||
- name: Install npm packages | ||
run: npm install | ||
- name: Build dist | ||
run: npm run build | ||
- name: Create archives | ||
run: | | ||
name='geotool-${{ steps.version.outputs.version }}' | ||
mkdir "$name" | ||
cp -pr ./dist/* "./${name}/" | ||
cp -p ./LICENSE "./${name}/" | ||
cp -p ./README.md "./${name}/" | ||
tar -czpf "${name}.tar.gz" "$name" | ||
zip "${name}.zip" "$name" | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: v${{ steps.version.outputs.version }} | ||
draft: false | ||
files: | | ||
geotool-${{ steps.version.outputs.version }}.tar.gz | ||
geotool-${{ steps.version.outputs.version }}.zip |