|
| 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 | +[](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