You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-22Lines changed: 18 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,50 +64,46 @@ run()
64
64
65
65
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
66
66
67
-
## Publish to a distribution branch
67
+
## Package for distribution
68
68
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.
70
70
71
71
Comment out node_modules in .gitignore and create a releases/v1 branch
72
72
```bash
73
-
# comment this out distribution branches
74
-
# node_modules/
73
+
npm run package
75
74
```
76
75
76
+
Since the packaged index.js is run from the dist folder, check it in.
77
+
77
78
```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"
80
89
```
81
90
82
91
```bash
83
-
$ npm prune --production
84
-
$ git add node_modules
85
-
$ git commit -a -m "prod dependencies"
86
92
$ git push origin releases/v1
87
93
```
88
94
89
95
Your action is now published! :rocket:
90
96
91
97
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
92
98
93
-
## Validate
99
+
## Usage
94
100
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
96
102
97
103
```yaml
98
-
uses: actions/javascript-action@releases/v1
104
+
uses: actions/javascript-action@v1
99
105
with:
100
106
milliseconds: 1000
101
107
```
102
108
103
109
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
0 commit comments