forked from anbuksv/avantation
-
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.
Merge pull request #8 from anbuksv/master
Merge from upstream
- Loading branch information
Showing
8 changed files
with
159 additions
and
7 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,63 @@ | ||
name: Avantation Package Build Test | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
Avantation: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Install oclif-dev | ||
run: npm install -g @oclif/dev-cli | ||
|
||
- name: Testing | ||
run: npm run test | ||
|
||
- name: Package metadata | ||
id: metadata | ||
run: | | ||
set -x | ||
sudo apt-get install jq | ||
export PACKAGE_VERSION=$(cat package.json | jq -r .version) | ||
export PACKAGE_NAME="avantation-v${PACKAGE_VERSION}" | ||
export PACKAGE_LIST="./dist/${PACKAGE_NAME}/*" | ||
echo "::set-output name=package-version::${PACKAGE_VERSION}" | ||
echo "::set-output name=package-name::${PACKAGE_NAME}" | ||
echo "::set-output name=package-dir::${PACKAGE_LIST}" | ||
- name: Package Build | ||
run: | | ||
oclif-dev pack --root avantation | ||
# - name: Create Release | ||
# id: create_release | ||
# uses: actions/create-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ github.token }} | ||
# with: | ||
# tag_name: tv1.0.0 #${{ github.ref }} | ||
# release_name: Release tv1.0.0 #${{ github.ref }} | ||
# body_path: Hello world #${{ steps.changelog.outputs.path }} | ||
# draft: false | ||
|
||
- name: Release package to Github #ref: https://hub.github.com/hub-release.1.html | ||
id: upload-plugin-asset | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
set -x | ||
assets=() | ||
export DIR="${{ steps.metadata.outputs.package-dir }}" | ||
for asset in $DIR; do | ||
assets+=("-a" "$asset") | ||
done | ||
tag_name="tv1.0.0" #"${GITHUB_REF##*/}" | ||
hub release create "${assets[@]}" -d -m "$tag_name" "v${{ steps.metadata.outputs.package-name }}" |
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,16 @@ | ||
name: Manual Release Package to NPM | ||
on: workflow_dispatch | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm install | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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,54 @@ | ||
name: Build and Create Github Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
Avantation: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Install oclif-dev | ||
run: npm install -g @oclif/dev-cli | ||
|
||
- name: Testing | ||
run: npm run test | ||
|
||
- name: Package metadata | ||
id: metadata | ||
run: | | ||
set -x | ||
sudo apt-get install jq | ||
export PACKAGE_VERSION=$(cat package.json | jq -r .version) | ||
export PACKAGE_NAME="avantation-v${PACKAGE_VERSION}" | ||
export PACKAGE_LIST="./dist/${PACKAGE_NAME}/*" | ||
echo "::set-output name=package-version::${PACKAGE_VERSION}" | ||
echo "::set-output name=package-name::${PACKAGE_NAME}" | ||
echo "::set-output name=package-dir::${PACKAGE_LIST}" | ||
- name: Package Build | ||
run: oclif-dev pack | ||
|
||
- name: Release package to Github #ref: https://hub.github.com/hub-release.1.html | ||
id: upload-plugin-asset | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
set -x | ||
assets=() | ||
export DIR="${{ steps.metadata.outputs.package-dir }}" | ||
for asset in $DIR; do | ||
assets+=("-a" "$asset") | ||
done | ||
tag_name="${GITHUB_REF##*/}" #${{ github.ref }} | ||
hub release create "${assets[@]}" -m "$tag_name" "${{ steps.metadata.outputs.package-name }}" |
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,18 @@ | ||
name: Release Package to NPM | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm install | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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