-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: node20 update * feat: add basic test
- Loading branch information
Showing
8 changed files
with
5,735 additions
and
5,474 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release | ||
|
||
on: [push] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npm run release | ||
env: | ||
GITHUB_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,36 @@ | ||
name: Test | ||
|
||
on: [push] | ||
|
||
env: | ||
EXPECTED: "3.14.16" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "npm" | ||
- run: npm ci | ||
- run: mkdir ./test_1 | ||
- run: | | ||
echo '{"version": "${{ env.EXPECTED }}"}' > ./test_1/package.json | ||
- name: Test 1 | ||
id: package_ver | ||
uses: ./ | ||
with: | ||
path: ./test_1 | ||
|
||
- name: Check results | ||
uses: actions/github-script@v7 | ||
env: | ||
RECEIVED: ${{ steps.package_ver.outputs.version }} | ||
with: | ||
script: | | ||
const { EXPECTED, RECEIVED } = process.env; | ||
if (RECEIVED !== RECEIVED) | ||
core.setFailed(`Expected [${EXPECTED}], but got [${RECEIVED}]`) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,15 +24,12 @@ jobs: | |
name: Create Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Extract version | ||
id: extract_version | ||
uses: Saionaro/[email protected] | ||
# From now you can access the version | ||
- name: Print version | ||
run: echo ${{ steps.extract_version.outputs.version }} | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: saionaro/[email protected] | ||
id: package_ver | ||
# from now you can access the version | ||
- run: echo ${{ steps.package_ver.outputs.version }} | ||
``` | ||
### Example workflow - get NPM version of subdirectory (useful in monorepos) | ||
|
@@ -47,15 +44,12 @@ jobs: | |
name: Create Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract version | ||
id: extract_version | ||
uses: Saionaro/[email protected] | ||
- uses: saionaro/[email protected] | ||
id: package_ver | ||
with: | ||
path: mysubdir | ||
# From now you can access the version | ||
- name: Print version | ||
run: echo ${{ steps.extract_version.outputs.version }} | ||
# from now you can access the version | ||
- run: echo ${{ steps.package_ver.outputs.version }} | ||
``` |
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.