-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create manually_test.yml * feature: init V7.0.0 * add comment to interface and main func & update readme --------- Co-authored-by: m.r <mr@example.com>
- Loading branch information
1 parent
01458f8
commit d322cb4
Showing
55 changed files
with
5,966 additions
and
4,325 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
.github/workflows/manually-npm-publish-github-packages.yaml
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,44 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: Manually Publish Github Package | ||
|
||
# on: | ||
# release: | ||
# types: [created] | ||
# name: Manually Test | ||
on: | ||
workflow_dispatch | ||
# inputs: | ||
# branch: | ||
# description: 'Branch for Publish' | ||
# required: true | ||
# default: 'main' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- run: npm ci | ||
- run: npm test | ||
|
||
publish-gpr: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
registry-url: https://npm.pkg.github.com/ | ||
- run: npm ci | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_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,102 @@ | ||
name: Manually Release & Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
skip-release: | ||
description: 'Skip Release Job' | ||
required: true | ||
default: 'false' | ||
type: choice | ||
options: | ||
- 'false' | ||
- 'true' | ||
skip-publish-gpr: | ||
description: 'Skip publish Github Job' | ||
required: true | ||
default: 'false' | ||
type: choice | ||
options: | ||
- 'false' | ||
- 'true' | ||
# push: | ||
# branches: | ||
# - main | ||
# paths: | ||
# - CHANGELOG.md | ||
# pull_request: | ||
# branches: | ||
# - main | ||
# paths: | ||
# - CHANGELOG.md | ||
jobs: | ||
release: | ||
if: ${{ github.event.inputs.skip-release == 'false' }} | ||
name: Create release package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout to code | ||
uses: actions/checkout@v4 | ||
- name: install Node js Version 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
- name: Retrieve Release Version | ||
run: echo "PV=$(node version.js)" >> $GITHUB_ENV | ||
- run: cat change-log | ||
- name: Retrieve Release Body | ||
run: | | ||
{ | ||
echo 'PB<<EOF' | ||
cat change-log | ||
echo EOF | ||
} >> $GITHUB_ENV | ||
- run: echo ${{env.PV}} | ||
- name: Create Github Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{env.PV}} | ||
release_name: Release v${{env.PV}} | ||
body: ${{env.PB}} | ||
publish-gpr: | ||
needs: release | ||
if: ${{always() && (needs.release.result == 'success' || needs.release.result == 'skipped') && github.event.inputs.skip-publish-gpr == 'false'}} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Setup .npmrc file to publish to GitHub Packages | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://npm.pkg.github.com' | ||
# Defaults to the user or organization that owns the workflow file | ||
scope: '@mohammadrezaeicode' | ||
- run: npm set @mohammadrezaeicode:registry=https://npm.pkg.github.com/ | ||
- run: npm login --scope=@mohammadrezaeicode --registry=https://npm.pkg.github.com | ||
- run: npm adduser | ||
- run: npm ci | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
publish: | ||
name: Publish to NPM | ||
needs: publish-gpr | ||
if: ${{always() && (needs.publish-gpr.result == 'success' || needs.publish-gpr.result == 'skipped') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout to code | ||
uses: actions/checkout@v4 | ||
- name: install Node js Version 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
- name: publish to npm | ||
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,39 @@ | ||
name: Manually Test | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Test Branch' | ||
required: true | ||
default: 'main' | ||
os: | ||
description: 'Operating System' | ||
type: choice | ||
required: true | ||
default: 'ubuntu-latest' | ||
options: | ||
- 'windows-latest' | ||
- 'ubuntu-latest' | ||
node_version: | ||
description: 'Node Environment' | ||
required: true | ||
default: '20.x' | ||
jobs: | ||
test: | ||
name: Test | ||
timeout-minutes: 30 | ||
continue-on-error: true | ||
runs-on: ${{ github.event.inputs.os }} | ||
steps: | ||
- name: Checkout to code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
- name: install Node js Version 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ github.event.inputs.node_version }} | ||
- name: install dependency | ||
run: npm install | ||
- name: Run test | ||
run: npm run test |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
@mohammadrezaeicode:registry=https://npm.pkg.github.com | ||
//@npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} | ||
mohammadrezaeicode:registry=https://npm.pkg.github.com | ||
always-auth=true |
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
Oops, something went wrong.