Skip to content

Commit b2ef944

Browse files
pkg action
1 parent a2b6fc1 commit b2ef944

5 files changed

Lines changed: 434 additions & 36 deletions

File tree

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,50 +64,46 @@ 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 self encapsulated distribution runnable from the GitHub graph.
7070

7171
Comment out node_modules in .gitignore and create a releases/v1 branch
7272
```bash
73-
# comment this out distribution branches
74-
# node_modules/
73+
npm run package
7574
```
7675

76+
Since the packaged index.js is run from the dist folder, check it in.
77+
7778
```bash
78-
$ git checkout -b releases/v1
79-
$ git commit -a -m "prod dependencies"
79+
git add dist
80+
```
81+
82+
## Create a release branch
83+
84+
Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.
85+
86+
```bash
87+
$ git checkout -b v1
88+
$ git commit -a -m "v1 release"
8089
```
8190

8291
```bash
83-
$ npm prune --production
84-
$ git add node_modules
85-
$ git commit -a -m "prod dependencies"
8692
$ git push origin releases/v1
8793
```
8894

8995
Your action is now published! :rocket:
9096

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

93-
## Validate
99+
## Usage
94100

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

97103
```yaml
98-
uses: actions/javascript-action@releases/v1
104+
uses: actions/javascript-action@v1
99105
with:
100106
milliseconds: 1000
101107
```
102108
103109
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)