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
{{ message }}
This repository was archived by the owner on Dec 22, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+10-55Lines changed: 10 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
2
2
3
3
This repository contains a simple GitHub Action implementation which allows you to attach binaries to a new (github) release of your repository.
4
4
5
+
*[GitHub Action for Uploading Release Artifacts](#github-action-for-uploading-release-artifacts)
6
+
*[Enabling the action](#enabling-the-action)
7
+
*[Sample Configuration](#sample-configuration)
8
+
*[GITHUB_TOKEN](#github_token)
9
+
5
10
6
11
## Enabling the action
7
12
@@ -12,14 +17,11 @@ There are two steps required to use this action:
12
17
* You'll specify a pattern to describe which binary-artifacts are uploaded.
13
18
* Ensure your binary artifacts are generated.
14
19
* Ideally you should do this in your workflow using another action.
15
-
* But if you're in a hurry you can add a project-specific `.github/build` script.
16
-
17
20
18
-
## Sample Configuration: Preferred
19
21
20
-
The following configuration file uses this action, along with another to build a project.
22
+
## Sample Configuration
21
23
22
-
This is the preferred approach:
24
+
The following configuration file uses _this_ action, along with the [github-action-build](https://github.com/skx/github-action-build) action to generate the artifacts for a project, then attach them to a release.
23
25
24
26
```
25
27
on:
@@ -33,9 +35,9 @@ jobs:
33
35
steps:
34
36
- name: Checkout the repository
35
37
uses: actions/checkout@master
36
-
- name: Generate artifacts
38
+
- name: Generate the artifacts
37
39
uses: skx/github-action-build@master
38
-
- name: Upload artifacts
40
+
- name: Upload the artifacts
39
41
uses: skx/github-action-publish-binaries@master
40
42
env:
41
43
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -51,56 +53,9 @@ This is the preferred approach because it uses a pair of distinct actions, each
* Uploads the previously-generated the build artifacts.
53
55
54
-
**NOTE**: Please see the note about GITHUB_TOKEN later.
55
-
56
-
57
-
58
-
## Sample Configuration: Legacy
59
-
60
-
In the past this action performed __both__ steps:
61
-
62
-
* Generated the artifacts
63
-
* Uploaded the artifacts
64
-
65
-
That is still possible, but will be removed when actions come out of beta.
66
-
67
-
For the moment you can continue to work as you did before, add the script `.github/build` to your repository, and configure this action with a pattern of files to upload.
68
-
69
-
For example the following usage, defined in `.github/workflows/release.yml`, uploads files matching the pattern `puppet-summary-*`.
70
-
71
-
```
72
-
on:
73
-
release:
74
-
types: [created]
75
-
name: Handle Release
76
-
jobs:
77
-
upload:
78
-
name: Upload Artifacts
79
-
runs-on: ubuntu-latest
80
-
steps:
81
-
- uses: actions/checkout@master
82
-
- name: Upload
83
-
uses: skx/github-action-publish-binaries@master
84
-
env:
85
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86
-
with:
87
-
args: 'puppet-summary-*'
88
-
```
89
-
90
-
We assume that the `.github/build` script generated suitable binaries. For example a go-based project might create files like this using cross-compilation:
91
-
92
-
*`puppet-summary-linux-i386`
93
-
*`puppet-summary-linux-amd64`
94
-
*`puppet-summary-darwin-i386`
95
-
*`puppet-summary-darwin-amd64`
96
-
* ....
97
-
98
-
99
-
**NOTE**: Please see the note about GITHUB_TOKEN later.
100
-
101
56
102
57
## GITHUB_TOKEN
103
58
104
-
Your workflow configuration file, named `.github/workflows/release.yml`, will contain a reference to `secrets.GITHUB_TOKEN`, however you do __not__ need to generate that, or update your project settings in any way.
59
+
Your workflow configuration file, named `.github/workflows/release.yml`, will contain a reference to `secrets.GITHUB_TOKEN`, however you do __not__ need to generate that, or update your project settings in any way!
105
60
106
61
You _can_ inject secrets into workflows, defining them in the project settings, and referring to them by name, but the `GITHUB_TOKEN` value is special and it is handled transparently, requiring no manual setup.
0 commit comments