Skip to content

Commit d080a47

Browse files
Merge pull request actions#5 from actions/pkgaction
Package action and do not checkin node_modules in any branch
2 parents a2b6fc1 + e4a2aab commit d080a47

File tree

5 files changed

+403
-34
lines changed

5 files changed

+403
-34
lines changed

README.md

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,50 +64,47 @@ run()
6464

6565
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
6666

67-
## Publish to a distribution branch
67+
## Package for distribution
6868

69-
Actions are run from GitHub repos. We will create a releases branch and only checkin production modules (core in this case).
69+
Actions are run from GitHub repos. Packaging the action will create a packaged action in the dist folder.
70+
71+
Run package
72+
73+
```bash
74+
npm run package
75+
```
76+
77+
Since the packaged index.js is run from the dist folder, check it in.
7078

71-
Comment out node_modules in .gitignore and create a releases/v1 branch
7279
```bash
73-
# comment this out distribution branches
74-
# node_modules/
80+
git add dist
7581
```
7682

83+
## Create a release branch
84+
85+
Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.
86+
7787
```bash
78-
$ git checkout -b releases/v1
79-
$ git commit -a -m "prod dependencies"
88+
$ git checkout -b v1
89+
$ git commit -a -m "v1 release"
8090
```
8191

8292
```bash
83-
$ npm prune --production
84-
$ git add node_modules
85-
$ git commit -a -m "prod dependencies"
8693
$ git push origin releases/v1
8794
```
8895

8996
Your action is now published! :rocket:
9097

9198
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
9299

93-
## Validate
100+
## Usage
94101

95-
You can now validate the action by referencing the releases/v1 branch
102+
You can now consume the action by referencing the v1 branch
96103

97104
```yaml
98-
uses: actions/javascript-action@releases/v1
105+
uses: actions/javascript-action@v1
99106
with:
100107
milliseconds: 1000
101108
```
102109
103110
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket:
104-
105-
## Usage:
106-
107-
After testing you can [create a v1 tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) to reference the stable and tested action
108-
109-
```yaml
110-
uses: actions/javascript-action@v1
111-
with:
112-
milliseconds: 1000
113-
```

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ outputs:
1010
description: 'The message to output'
1111
runs:
1212
using: 'node12'
13-
main: 'index.js'
13+
main: 'dist/index.js'

0 commit comments

Comments
 (0)