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
+20-23Lines changed: 20 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -64,50 +64,47 @@ 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 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.
70
78
71
-
Comment out node_modules in .gitignore and create a releases/v1 branch
72
79
```bash
73
-
# comment this out distribution branches
74
-
# node_modules/
80
+
git add dist
75
81
```
76
82
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
+
77
87
```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"
80
90
```
81
91
82
92
```bash
83
-
$ npm prune --production
84
-
$ git add node_modules
85
-
$ git commit -a -m "prod dependencies"
86
93
$ git push origin releases/v1
87
94
```
88
95
89
96
Your action is now published! :rocket:
90
97
91
98
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
92
99
93
-
## Validate
100
+
## Usage
94
101
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
96
103
97
104
```yaml
98
-
uses: actions/javascript-action@releases/v1
105
+
uses: actions/javascript-action@v1
99
106
with:
100
107
milliseconds: 1000
101
108
```
102
109
103
110
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