Remove actionVersion
This commit is contained in:
parent
9c76216823
commit
104fad35ae
|
@ -26,7 +26,7 @@ jobs:
|
|||
|
||||
- name: Get Package Version
|
||||
id: package-version
|
||||
run: node -p "require('./utils').actionVersion()" >> $GITHUB_OUTPUT
|
||||
run: node -p "version=${require('./package').version}" >> $GITHUB_OUTPUT
|
||||
|
||||
# - name: Publish
|
||||
# run: |
|
||||
|
|
|
@ -38,7 +38,7 @@ JavaScript helpers for Node.js addon development. The short list of helpers:
|
|||
'install', 'cpbin', 'download', 'read', 'write', 'copy', 'exists',
|
||||
'mkdir', 'stat', 'isDir', 'isFile', 'dirUp', 'ensuredir', 'copysafe',
|
||||
'readdir', 'subdirs', 'subfiles', 'traverse', 'copyall',
|
||||
'rmdir', 'rm', 'WritableBuffer', 'actionVersion', 'actionZip',
|
||||
'rmdir', 'rm', 'WritableBuffer', 'actionZip',
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -77,23 +77,6 @@ declare module "addon-tools-raub" {
|
|||
export const cpbin: (name: string) => Promise<void>;
|
||||
|
||||
|
||||
/**
|
||||
* Package version for GitHub Actions
|
||||
* Example of `actionVersion` usage in **Github Actions**:
|
||||
*
|
||||
* ```
|
||||
* - name: Get Package Version
|
||||
* id: package-version
|
||||
* run: node -p "require('addon-tools-raub').actionVersion()" >> $GITHUB_OUTPUT
|
||||
* - name: Create Release
|
||||
* uses: softprops/action-gh-release@v1
|
||||
* with:
|
||||
* tag_name: ${{ steps.package-version.outputs.version }}
|
||||
* ```
|
||||
*/
|
||||
export const actionVersion: () => void;
|
||||
|
||||
|
||||
/**
|
||||
* Package version for GitHub Actions
|
||||
* Example of `actionZip` usage in **Github Actions**:
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
|
||||
module.exports = {
|
||||
actionVersion: () => `version=${process.env.npm_package_version}`,
|
||||
};
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
|
||||
module.exports = {
|
||||
...require('./action-version'),
|
||||
...require('./action-zip'),
|
||||
...require('./cpbin'),
|
||||
...require('./download'),
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const util = require('node:util');
|
||||
const exec = util.promisify(require('node:child_process').exec);
|
||||
|
||||
const utils = require('.');
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
|
||||
describe('AT / utils', () => {
|
||||
|
@ -12,7 +8,7 @@ describe('AT / utils', () => {
|
|||
'install', 'cpbin', 'download', 'read', 'write', 'copy', 'exists',
|
||||
'mkdir', 'stat', 'isDir', 'isFile', 'dirUp', 'ensuredir', 'copysafe',
|
||||
'readdir', 'subdirs', 'subfiles', 'traverse', 'copyall',
|
||||
'rmdir', 'rm', 'WritableBuffer', 'actionVersion', 'actionZip',
|
||||
'rmdir', 'rm', 'WritableBuffer', 'actionZip',
|
||||
];
|
||||
|
||||
methods.forEach((name) => {
|
||||
|
@ -20,11 +16,4 @@ describe('AT / utils', () => {
|
|||
expect(typeof utils[name]).toBe('function');
|
||||
});
|
||||
});
|
||||
|
||||
describe('actionVersion', () => {
|
||||
it('logs package version', async () => {
|
||||
const { stdout } = await exec('node -p "require(\'./utils\').actionVersion()"');
|
||||
expect(stdout).toBe(`version=${packageJson.version}\n`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue