Skip to content

Commit

Permalink
Make release tag pattern not prefixed with 'v'.
Browse files Browse the repository at this point in the history
Signed-off-by: Jianfei Hu <[email protected]>
  • Loading branch information
incfly committed Apr 8, 2022
1 parent 23a7564 commit 28404a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "release" # please read on RELEASE.md on how to trigger this workflow.
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+**" # For example: v0.5.0 v0.5.1-rc2
- "[0-9]+.[0-9]+.[0-9]+**" # For example: 0.5.0, 0.5.1-rc2.

defaults:
run: # use bash for all operating systems unless overridden.
Expand Down Expand Up @@ -73,8 +73,9 @@ jobs:
if: matrix.mode == 'clang-fips'
run: echo "BAZEL_FLAGS=--config=libc++ --define=boringssl=fips" >> $GITHUB_ENV

- name: Create artifacts # We strip the "v"-prefix from the current tag.
run: VERSION=${GITHUB_REF#refs/tags/v} MODE=${{ matrix.mode }} make dist
- name: Create artifacts
# GITHUB_REF: refs/tags/0.5.1-rc1, resulted VERSION: "0.5.1".
run: VERSION=${GITHUB_REF#refs/tags/} MODE=${{ matrix.mode }} make dist

- name: Require static binary
if: runner.os == 'Linux' && matrix.mode == 'clang'
Expand Down
24 changes: 19 additions & 5 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,24 @@
## Release workflow

The release workflow defined in [`.github/workflows/release.yaml`](./.github/workflows/release.yaml)
will be triggered whenever a tag that matches `v[0-9]+.[0-9]+.[0-9]+**` (examples of valid tags:
`v0.5.0`, `v0.5.1-rc2`) is created. The workflow invokes the `make dist` command to create tarballs
will be triggered whenever a tag that matches `[0-9]+.[0-9]+.[0-9]+**` (examples of valid tags:
`0.5.0`, `0.5.1-rc2`) is created. The workflow invokes the `make dist` command to create tarballs
from the combination of `os` (`darwin` and `linux`) with the selected mode (`default`, `clang`, and
`clang-fips`). The tarball name pattern will be: `auth_server_<os>_amd64_<mode>_<version>.tar.gz`.
The version is the same as the given tag with `v` prefix removed. After the tarballs are created,
the workflow uploads the tarballs as attachments to the created release entry on
https://github.com/istio-ecosystem/authservice/releases.
After the tarballs are created, the workflow uploads the tarballs as attachments to the created
release entry on https://github.com/istio-ecosystem/authservice/releases.

## Make a Release

To make a release, create an tag at the commit you want. For example

```sh
git tag -a "0.5.1"
git push upstsream HEAD # You must have admin permission for the repo.
```

Github Action will detect the newly created tags and trigger the workflow. Check [Action Runs](https://github.com/istio-ecosystem/authservice/actions)
and watch for its completion.

Once workflow completes, go to [Release](https://github.com/istio-ecosystem/authservice/releases)
page and draft the release notes, provide Docker image links.

2 comments on commit 28404a8

@incfly
Copy link
Author

@incfly incfly commented on 28404a8 Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dio oops, sorry, I was intended to do a PR instead, but get into some bad habit when developing some other projects recently...
therefore push to "master" directly. Anyway, let me know if you spot out some wrong things and I can change that.

@dio
Copy link
Collaborator

@dio dio commented on 28404a8 Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more thing: seems like we still use the default VERSION, i.e. using git describe:

VERSION ?= $(shell git describe --tags --long --dirty --always)
instead of the tag value as the tag for the published image. We have two options:

  1. Run make image push with inlined VERSION, similar to:
    run: VERSION=${GITHUB_REF#refs/tags/} MODE=${{ matrix.mode }} make dist
  2. Export VERSION to $GITHUB_ENV (just in case you need example:
    echo "BAZEL_FLAGS=--config=libc++" >> $GITHUB_ENV
    ).

Thanks!

Please sign in to comment.