Skip to content

Commit

Permalink
Modify github test actions and add release action (easegress-io#433)
Browse files Browse the repository at this point in the history
* modify github test actions and add release action

* write down the steps to release new version

* Update doc/reference/maintain.md

Co-authored-by: Bomin Zhang <[email protected]>

Co-authored-by: Bomin Zhang <[email protected]>
  • Loading branch information
Samu Tamminen and localvar committed Jan 7, 2022
1 parent f6fd525 commit 13ccc6a
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 3 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v2
with:
go-version: ^1.16.5

- name: Checkout codebase
uses: actions/checkout@v2

- name: Test
shell: bash
run: |
make test TEST_FLAGS="-race -covermode=atomic"
test-win:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v2
with:
go-version: ^1.16.5

- name: Checkout codebase
uses: actions/checkout@v2

- name: Test
run: |
go mod verify
go mod download
go test -v ./...
integration-test-ubuntu:
needs: [test, test-win]
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v2
with:
go-version: ^1.16.5

- name: Checkout codebase
uses: actions/checkout@v2

- name: Test
run: |
make httpserver_test
goreleaser:
runs-on: ubuntu-latest
needs: integration-test-ubuntu
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
go mod download
go test -v ./...
integration-test-ubuntu:
needs: test
needs: [test, test-win]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ builds:
- darwin
ldflags:
- -s -w
- -X github.com/megaease/easegress/pkg/version.RELEASE=v1.4.0
- -X github.com/megaease/easegress/pkg/version.RELEASE={{ .Tag }}
- -X github.com/megaease/easegress/pkg/version.COMMIT={{.Commit}}
- -X github.com/megaease/easegress/pkg/version.REPO=megaease/easegress

Expand All @@ -37,7 +37,7 @@ builds:
- darwin
ldflags:
- -s -w
- -X github.com/megaease/easegress/pkg/version.RELEASE=v1.4.0
- -X github.com/megaease/easegress/pkg/version.RELEASE={{ .Tag }}
- -X github.com/megaease/easegress/pkg/version.COMMIT={{.Commit}}
- -X github.com/megaease/easegress/pkg/version.REPO=megaease/easegress

Expand Down
15 changes: 15 additions & 0 deletions doc/reference/maintain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Release steps

These are the steps to release new version of Easegress.

## Pre-requisites

Let's suppose that the next version is `X.Y.Z`. Then new *tag* is `vX.Y.Z` (note prefix `v`) and new *release title* is `easegress-vX.Y.Z`. Please collect all Pull Request's that will be mentioned in `CHANGELOG.md` and in the Release Note.

## Steps

1. Create a Pull Request that updates release version `X.Y.Z` in Makefile and adds the new version to `CHANGELOG.md`. Include significant changes, implemented enchantments and fixed bugs to `CHANGELOG.md`. Once the PR is reviewed and approved, merge it to main branch.
2. Create new release note at https://github.com/megaease/easegress/releases/new with *release title* `easegress-vX.Y.Z` and click `Save draft`. Click *Choose a tag* and add new tag `vX.Y.Z`. Write the Release note. You can use the modifications written to `CHANGELOG.md` in previous step. Follow the same format, as previous Release notes. Once written, click `Publish release`.
3. New tag triggers Goreleaser Github action. Follow up that it creates and uploads successfully all binaries and Docker images.
4. Ensure that the release note created in step 2 contains the command to pull the new Docker image.
5. New version of Easegress is now released! Notify everyone to check it out!

0 comments on commit 13ccc6a

Please sign in to comment.