Skip to content

Commit a2053c9

Browse files
committed
Add documentation for Go release workflows
1 parent 65300cf commit a2053c9

File tree

2 files changed

+152
-0
lines changed

2 files changed

+152
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# "Publish Nightly Build" workflow (Go, Task)
2+
3+
Workflow file: [publish-go-nightly-task.yml](publish-go-nightly-task.yml)
4+
5+
Publish nightly builds of a [Go](https://golang.org/) project.
6+
7+
This is the version of the workflow for projects using the [Task](https://taskfile.dev/#/) task runner tool.
8+
9+
## Assets
10+
11+
See [the "Release" workflow (Go, Task) documentation](release-go-task.md#assets)
12+
13+
## Configuration
14+
15+
See [the "Release" workflow (Go, Task) documentation](release-go-task.md#configuration)
16+
17+
In addition, the following [repository secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) must be defined:
18+
19+
- `DD_API_KEY` - [Datadog](https://www.datadoghq.com/) API key.
20+
21+
## Readme badge
22+
23+
Markdown badge:
24+
25+
```markdown
26+
[![Publish Nightly Build status](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/publish-go-nightly-task.yml/badge.svg)](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/publish-go-nightly-task.yml)
27+
```
28+
29+
Replace the `REPO_OWNER` and `REPO_NAME` placeholders in the URLs with the final repository owner and name ([example](https://raw.githubusercontent.com/arduino-libraries/ArduinoIoTCloud/master/README.md)).
30+
31+
---
32+
33+
Asciidoc badge:
34+
35+
```adoc
36+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/publish-go-nightly-task.yml/badge.svg["Publish Nightly Build status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/publish-go-nightly-task.yml"]
37+
```
38+
39+
Define the `{repository-owner}` and `{repository-name}` attributes and use them throughout the readme ([example](https://raw.githubusercontent.com/arduino-libraries/WiFiNINA/master/README.adoc)).
40+
41+
## Commit message
42+
43+
```
44+
Add CI workflow to publish nightly builds
45+
46+
On a daily schedule:
47+
48+
- Build the project for all supported platforms.
49+
- Sign and notarize the macOS build.
50+
- Upload the builds to Arduino's downloads server.
51+
52+
This will enable everyone to participate to the project's development via beta testing.
53+
```
54+
55+
## PR message
56+
57+
```markdown
58+
On a daily schedule:
59+
60+
- Build the project for all supported platforms.
61+
- Use [gon](https://github.com/mitchellh/gon) to sign and notarize the macOS build.
62+
- Upload the builds to Arduino's downloads server.
63+
64+
This will enable everyone to participate to the project's development via beta testing.
65+
```
66+
67+
## Related
68+
69+
- ["Release" workflow (Go, Task)](release-go-task.md)

workflow-templates/release-go-task.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# "Release" workflow (Go, Task)
2+
3+
Workflow file: [release-go-task.yml](release-go-task.yml)
4+
5+
Make a production release of the [Go](https://golang.org/) project.
6+
7+
This is the version of the workflow for projects using the [Task](https://taskfile.dev/#/) task runner tool.
8+
9+
## Assets
10+
11+
- [`Taskfile.yml`](assets/release-go-task/Taskfile.yml] - [variables](https://taskfile.dev/#/usage?id=variables) providing project-specific data to the build system.
12+
- Install to: repository root (or merge into the existing `Taskfile.yml`)
13+
- [`DistTasks.yml`](assets/release-go-task/DistTasks.yml] - general purpose tasks for making production builds of Go projects.
14+
- Install to: repository root
15+
- [`gon.config.hcl`](assets/shared/gon.config.hcl] - [gon](https://github.com/mitchellh/gon) configuration file for macOS signing and notarization.
16+
- Install to: repository root
17+
18+
## Configuration
19+
20+
The following [repository secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) must be defined:
21+
22+
- `INSTALLER_CERT_MAC_P12` - the [Apple Developer ID](https://developer.apple.com/support/developer-id/) signing certificate, exported in [PKCS #12 format](https://en.wikipedia.org/wiki/PKCS_12) and then encoded into base64 as described [here](https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/#exporting-the-developer-certificate).
23+
- `INSTALLER_CERT_MAC_PASSWORD` - the password used to encrypt the Apple Developer ID signing certificate during the export process.
24+
- `AC_USERNAME` - the Apple ID username associated with the certificate.
25+
- **Note**: not likely to be a problem when using Arduino's standard credentials, but in the event the username is a member of multiple Apple Developer Program teams, you will also need to define the App Store Connect provider via [the `AC_PROVIDER` environment variable](https://github.com/mitchellh/gon#configuration-file). You can use the ID of the certificate identity (e.g., `7KT7ZWMCJT`) for this.
26+
- `AC_PASSWORD` - [App-specific password](https://support.apple.com/en-us/HT204397) created for the Apple ID.
27+
- `DOWNLOADS_BUCKET` - [AWS bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html) on the downloads server.
28+
- `AWS_ACCESS_KEY_ID` - [AWS access key ID](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) for the downloads server.
29+
- `AWS_SECRET_ACCESS_KEY` - [AWS secret access key](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) for the downloads server.
30+
31+
## Readme badge
32+
33+
Markdown badge:
34+
35+
```markdown
36+
[![Release status](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/release-go-task.yml/badge.svg)](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/release-go-task.yml)
37+
```
38+
39+
Replace the `REPO_OWNER` and `REPO_NAME` placeholders in the URLs with the final repository owner and name ([example](https://raw.githubusercontent.com/arduino-libraries/ArduinoIoTCloud/master/README.md)).
40+
41+
---
42+
43+
Asciidoc badge:
44+
45+
```adoc
46+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/release-go-task.yml/badge.svg["Release status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/release-go-task.yml"]
47+
```
48+
49+
Define the `{repository-owner}` and `{repository-name}` attributes and use them throughout the readme ([example](https://raw.githubusercontent.com/arduino-libraries/WiFiNINA/master/README.adoc)).
50+
51+
## Commit message
52+
53+
```
54+
Add CI workflow to publish releases
55+
56+
On every push of a tag named with a version format:
57+
58+
- Build the project for all supported platforms.
59+
- Sign and notarize the macOS build.
60+
- Create a GitHub release.
61+
- Builds and checksums are attached as release assets
62+
- A changelog generated from the commit history is added to the release description
63+
- If the tag has a pre-release version suffix, the GitHub release will be marked as a pre-release.
64+
- Upload the builds to Arduino's downloads server.
65+
```
66+
67+
## PR message
68+
69+
```markdown
70+
On every push of a tag named with a version format:
71+
72+
- Build the project for all supported platforms.
73+
- Use [gon](https://github.com/mitchellh/gon) to sign and notarize the macOS build.
74+
- Create a [GitHub release](https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/about-releases).
75+
- Builds and checksums are attached as release assets
76+
- A changelog generated by [`arduino/create-changelog](https://github.com/arduino/create-changelog) from the commit history is added to the release description
77+
- If the tag has [a pre-release version suffix](https://semver.org/), the GitHub release will be marked as a pre-release.
78+
- Upload the builds to Arduino's downloads server.
79+
```
80+
81+
## Related
82+
83+
- ["Publish Nightly Build" workflow (Go, Task)](publish-go-nightly-task.md)

0 commit comments

Comments
 (0)