Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build & attach release assets automatically #789

Merged
merged 45 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cf3e6ad
Add basic build workflow
Jul 17, 2020
b03145f
Merge branch 'master' into builds-experimental
Jul 23, 2020
bce9692
updated release process (draft)
Jul 23, 2020
8e85614
rename workflow
Jul 23, 2020
48f5279
add comment
Jul 23, 2020
dce426b
add release workflow
Jul 23, 2020
ace576d
more release generation
Jul 23, 2020
8462d5a
add a docker-compose file for local development- not sure yet if we'r…
Jul 24, 2020
9957e02
Merge branch 'master' into builds-experimental
Oct 28, 2020
57e89be
create binaries
Oct 29, 2020
de73998
rename
Oct 29, 2020
72c59a7
rename
Oct 29, 2020
a0de4cd
move it back
Oct 29, 2020
dc027b5
just on push for now
Oct 29, 2020
255a608
try Go 1.15.3 specifically
Oct 29, 2020
304acac
Merge branch 'master' into builds-experimental
Oct 29, 2020
d876dcb
make build.yml consistent with the other branch
Oct 29, 2020
4e4cbf2
let's try it!
Oct 29, 2020
51b0f57
fix indentation
Oct 29, 2020
66e7682
fix upload URL
Oct 29, 2020
14801d4
asset type
Oct 29, 2020
b493c3e
add Darwin and Linux
Oct 29, 2020
bfbaee9
zip source code
Oct 29, 2020
ecc3ca0
asset name
Oct 29, 2020
b647902
add tarball
Oct 29, 2020
a5d49a4
use a folder
Oct 29, 2020
dd25748
working directory for build
Oct 29, 2020
70b2d69
more paths
Oct 30, 2020
81bc1d6
label?
Oct 30, 2020
e9ea347
fix tags
Oct 30, 2020
267184c
remove docker-compose
Oct 30, 2020
09b1863
revert release doc for now
Oct 30, 2020
6971b24
add comment
Oct 30, 2020
29c1a3c
let's try this for a sec
Oct 30, 2020
8c33276
get existing release
Oct 30, 2020
3982edf
looks like GH is attaching the src code for us
Oct 30, 2020
1bc7736
let's try this!
Oct 30, 2020
7c73173
update upload_urls
Oct 30, 2020
856ca4f
don't need build here, it's in another PR already
Oct 30, 2020
db854c8
remove outdated TODO
Oct 30, 2020
0c2fe89
update docs
Oct 30, 2020
680a6ed
linkify
Oct 30, 2020
60d43da
simplify: we no longer need that folder
Oct 30, 2020
3b5746a
Merge branch 'master' into builds-experimental
Nov 1, 2020
bf7cb5b
Require Go 1.15 or higher, not 1.15.3 specifically
Nov 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
release:
types: [published]

name: release
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.15

- name: Build binaries
run: go run build/build.go

- name: Upload dnscontrol-Darwin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dnscontrol-Darwin
asset_name: dnscontrol-Darwin
asset_content_type: application/octet-stream

- name: Upload dnscontrol-Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dnscontrol-Linux
asset_name: dnscontrol-Linux
asset_content_type: application/octet-stream

- name: Upload dnscontrol.exe
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dnscontrol.exe
asset_name: dnscontrol.exe
asset_content_type: application/octet-stream
40 changes: 7 additions & 33 deletions docs/release-engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,44 +115,18 @@ Fill in the text box with the release notes written above.

(DO use the "preview" tab to proofread the text.)

Create the binaries and attach them to the release:

go run build/build.go
## Step 6. Publish the release

NOTE: This command creates binaries with the version number and git hash embedded. It also builds the releases for all supported platforms (i.e. creates a .exe for Windows even if you are running on Linux. Isn't Go amazing?)
a. Publish the release.

WARNING: if there are files that haven't been checked in, the version string will have "dirty" appended.

This is what it looks like when you did it right:

```
$ ./dnscontrol-Darwin version
dnscontrol 3.0.0 ("a7c62e5d317e7e3da76dffd8e24d6a9d304d8159") built 22 Mar 20 15:16 EDT
```

This is what it looks like when there was a file that wasn't checked in:

```
$ ./dnscontrol-Darwin version
dnscontrol 3.0.0 ("ee5208bd5f19b9e5dd0bdba8d0e13403c43a469a[dirty]") built 22 Mar 20 15:16 EDT
^^^^^
^^^^^
^^^^^
```


## Step 6. Attach the binaries and release.

a. Drag and drop binaries into the web form.

There is a box labeled "Attach binaries by dropping them here or
selecting them". Drag dnscontrol-Darwin, dnscontrol-Linux, and
dnscontrol.exe onto that box (one at a time or all at once). This
will upload the binaries.
Make sure the "This is a pre-release" checkbox is UNchecked. Then click "Publish Release".

b. Submit the release.
b. Wait for workflow to complete

Make sure the "This is a pre-release" checkbox is UNchecked. Then click "Publish Release".
There's a GitHub Actions [workflow](https://github.com/StackExchange/dnscontrol/actions?query=workflow%3Arelease) which automatically builds and attaches
all 3 binaries to the release. Refresh the page after a few minutes and you'll
see dnscontrol-Darwin, dnscontrol-Linux, and dnscontrol.exe attached as assets.


## Step 7. Announce it via email
Expand Down