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

Automate releases #401

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
13ad072
Run go mod tidy
tie May 13, 2021
2ff5fbe
Remove explicit versions from replace directives
tie May 13, 2021
d63e4ec
Added release workflow
tie May 13, 2021
aead527
Update .github/workflows/release-assets.yaml
tie May 14, 2021
b75dd62
Update .github/workflows/release.yaml
tie May 14, 2021
82618cb
Add files generated in release workflow to gitignore
tie May 14, 2021
c2e7d10
Allow pushing to release branch with explicit version
tie May 14, 2021
7530992
Add android/arm64 to build matrix
tie May 14, 2021
eb59a82
Fix badgerengine replace path in release workflow
tie May 14, 2021
5b6e2fb
Use go mod edit -require instead of go get
tie May 14, 2021
28a539d
Use gh for releases instead of deprecated action
tie May 14, 2021
f423b05
Set PR base to main branch
tie May 14, 2021
3983b87
Use gh for release workflow pull request
tie May 14, 2021
c7e1ec5
Don’t set label on release pull request
tie May 14, 2021
2611157
Don’t run fuzz workflow for release branch
tie May 14, 2021
b9da340
Create empty commit for root module version bump
tie May 14, 2021
e1c7ecb
Remove PR creation step
tie May 14, 2021
eb94716
Tag commits in separate jobs
tie May 14, 2021
e003170
Always use v0.0.0-devel for replaced modules
tie May 14, 2021
0135b07
Make job names shorter
tie May 14, 2021
f51b862
Remove no-op step from prepare job
tie May 14, 2021
3d1dcd1
Add dependabot config for actions
tie May 14, 2021
65c7311
Rollback release on failure
tie May 14, 2021
fb0cb91
Change some step names
tie May 14, 2021
77f06ec
Generate changelog for badgerengine after tagging root module
tie May 15, 2021
f7c07c2
Fix changelog path for badgerengine
tie May 15, 2021
982d73f
Use go1.16.4 in actions
tie May 15, 2021
dfa8155
Use even shorter job names in release workflow
tie May 15, 2021
bcd3839
Use shorter step names
tie May 15, 2021
9613e52
Rollback from separate job
tie May 15, 2021
c70a558
Also rollback draft release on failure
tie May 15, 2021
6d41416
Use author/action-rollback for untagging
tie May 15, 2021
05f30ac
Oops, fix typo
tie May 15, 2021
16e36ab
Fix author/action-rollback version
tie May 15, 2021
81ea76b
Fix author/action-rollback version one more time
tie May 15, 2021
a726371
Don’t use author/action-rollback for untagging, meh
tie May 15, 2021
77fbbae
Run go mod tidy before releasing root module
tie May 15, 2021
bcddd2d
Use latest release in development mode
tie May 15, 2021
403886d
Merge tags post-release
tie May 15, 2021
3edbd2d
Fix actions/github-script version
tie May 15, 2021
bf86bfa
Fetch tags in post-release workflow
tie May 15, 2021
3ec7165
Don’t fetch whole repo history in post-release
tie May 15, 2021
7670680
Push PR branch explicitly
tie May 15, 2021
013045d
Use gh for post-release pull request
tie May 15, 2021
bc8c26c
Checkout code before creating PR
tie May 15, 2021
0a62478
Ensure that release won’t run for tags merge
tie May 15, 2021
0518983
Move base version input below new version
tie May 15, 2021
e1031e5
Merge post-release into release workflow
tie May 15, 2021
5480938
Log git diff output before commit
tie May 15, 2021
1edee9c
Set GOPRIVATE in release-assets workflow
tie May 15, 2021
4c30c21
Set commitish to main on release
tie May 15, 2021
3c5571e
Run rollback after merge
tie May 15, 2021
8141e33
Update .github/workflows/release-assets.yaml
tie May 15, 2021
36ce470
Set concurrency group in release workflow
tie May 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: sunday
time: "10:00"
timezone: Etc/UTC
161 changes: 161 additions & 0 deletions .github/workflows/release-assets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Release Assets
on:
release:
types:
- published

env:
# Ensure that we still have a chance to remove tags even after release.
# See also release.yaml.
GOPRIVATE: github.com/genjidb/genji
# Enable reproducible builds.
GOFLAGS: -trimpath
CGO_ENABLED: '0'
GO_EXTLINK_ENABLED: '0'

jobs:
build:
name: Build
runs-on: ubuntu-latest
# Linux targets should be fixed in https://github.com/dgraph-io/ristretto/commit/6b99600c6cd958495fea33af2bf650c706da4c14
# Other are failing when compiling github.com/pkg/[email protected]/termios package.
# Plan9 target also fails when compiling bbolt. See https://github.com/etcd-io/bbolt/issues/231
#
# ios/arm64 requires Cgo and external linker, and ios/amd64, iOS Simulator, is just no worth it.
# Same for all android targets except android/arm64 (which we do build).
#
continue-on-error: ${{
matrix.os == 'openbsd' ||
matrix.os == 'freebsd' ||
matrix.os == 'plan9' ||
matrix.os == 'linux' && matrix.arch == 'mips64' ||
matrix.os == 'linux' && matrix.arch == 'mips64le' ||
matrix.os == 'linux' && matrix.arch == 'riscv64' ||
matrix.os == 'linux' && matrix.arch == 's390x' ||
matrix.os == 'dragonfly' ||
matrix.os == 'illumos' ||
matrix.os == 'solaris' ||
matrix.os == 'aix' ||
matrix.allow-failure != '' }}
strategy:
fail-fast: false
matrix:
os:
- linux
- darwin
- windows
- openbsd
- freebsd
- netbsd
- plan9
arch:
- amd64
- arm64
- 386
- arm
include:
# Extra linux targets
- os: linux
arch: mips
- os: linux
arch: mips64
- os: linux
arch: mips64le
- os: linux
arch: mipsle
- os: linux
arch: ppc64
- os: linux
arch: ppc64le
- os: linux
arch: riscv64
- os: linux
arch: s390x
# Misc targets
- os: android
arch: arm64
- os: dragonfly
arch: amd64
- os: illumos
arch: amd64
- os: solaris
arch: amd64
- os: aix
arch: ppc64
exclude:
# Needs go1.17. See https://github.com/golang/go/issues/36439#issuecomment-827089403
- os: windows
arch: arm64
# Not supported
- os: darwin
arch: 386
- os: darwin
arch: arm
- os: plan9
arch: arm64
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
steps:
- name: Install Go
uses: actions/[email protected]
with:
go-version: 1.16.4

- name: Get Go environment
id: go-env
run: |
echo "::set-output name=exe::$(go env GOEXE)"
echo "::set-output name=path::$(go env GOPATH)"
echo "::set-output name=hostos::$(go env GOHOSTOS)"
echo "::set-output name=hostarch::$(go env GOHOSTARCH)"
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=modcache::$(go env GOMODCACHE)"

- name: Set up modules cache
uses: actions/[email protected]
with:
path: ${{ steps.go-env.outputs.modcache }}
key: modcache-go-${{ hashFiles('**/go.sum') }}
restore-keys: modcache-go-

- name: Set up build cache
uses: actions/[email protected]
with:
path: ${{ steps.go-env.outputs.cache }}
key: cache-go-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('**/go.sum') }}
restore-keys: cache-go-${{ matrix.os }}-${{ matrix.arch }}-

- name: Get asset name
id: asset
run: echo "::set-output name=filename::genji_${GOOS}_${GOARCH}${GOEXE}"
env:
GOEXE: ${{ steps.go-env.outputs.exe }}

- name: Build release asset
env:
version: ${{ github.event.release.tag_name }}
run: go install github.com/genjidb/genji/cmd/genji@"${version}"

- name: Move asset to GOPATH/bin
if: ${{ steps.go-env.outputs.hostos != matrix.os || steps.go-env.outputs.hostarch != matrix.arch }}
working-directory: ${{ steps.go-env.outputs.path }}/bin/${{ matrix.os }}_${{ matrix.arch }}
run: mv genji"${GOEXE}" ..
env:
GOEXE: ${{ steps.go-env.outputs.exe }}

- name: Move asset to workspace
working-directory: ${{ steps.go-env.outputs.path }}/bin
run: mv genji"${GOEXE}" "${workspace}"/"${filename}"
env:
GOEXE: ${{ steps.go-env.outputs.exe }}
workspace: ${{ github.workspace }}
filename: ${{ steps.asset.outputs.filename }}

- name: Upload release asset
run: gh release upload -R="${repo}" "${tag_name}" "${filename}"
env:
repo: ${{ github.repository }}
tag_name: ${{ github.event.release.tag_name }}
filename: ${{ steps.asset.outputs.filename }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}