diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..74cd4568bd --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/docs/release-engineering.md b/docs/release-engineering.md index f3f2237330..03c318d072 100644 --- a/docs/release-engineering.md +++ b/docs/release-engineering.md @@ -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