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

ci: automate release process #829

Merged
merged 9 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
24 changes: 11 additions & 13 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@ name: Release
# This job will only be triggered when a tag (vX.X.x) is pushed
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10

- 'v[0-9]+.[0-9]+.[0-9]+*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3.4.0
with:
go-version: 1.18
- name: Unshallow
run: git fetch --prune --unshallow
- name: Create release
uses: goreleaser/goreleaser-action@v3
with:
args: release --rm-dist --release-notes ./RELEASE_NOTES.md
fetch-depth: 0
- run: git fetch --force --tags
- name: Build & Publish release
run: |
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_MOUNT_CONFIG: true
GORELEASER_IMAGE: line/gorel:1.0.0
GORELEASER_RELEASE: true
BUILD_TAGS: static
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83 changes: 65 additions & 18 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,74 @@
---
project_name: lbm-sdk

release:
github:
owner: line
name: lbm-sdk

before:
hooks:
- go mod tidy
builds:
- skip: true
- id: simd-linux-amd64
main: ./simapp/simd
binary: simd
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=1
flags:
- -mod=readonly
- -trimpath
- "-tags={{ .Env.BUILD_TAGS }}"
ldflags:
- "{{ .Env.BUILD_VARS }}"

archives:
- format: tar.gz
-
id: bin-archive
builds:
- simd-linux-amd64
format: tar.gz
name_template: "simd_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
name_template: "{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- LICENSE
- README.md
- NOTICE
- RELEASE_CHANGELOG.md

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
snapshot:
name_template: SNAPSHOT-{{ .Commit }}

name_template: "{{ incpatch .Version }}-next"
changelog:
skip: true
use: git
sort: asc
groups:
- title: "Breaking Changes"
regexp: '^.*?BREAKING CHANGE(\([[:word:]]+\))??!?:.+$'
order: 0
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 1
- title: 'Bug Fixes'
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 2
- title: 'Build, CI'
regexp: '^.*?(ci|build)(\([[:word:]]+\))??!?:.+$'
order: 3
- title: 'Document Updates'
regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$'
order: 4
- title: Improvements
regexp: '^.*?(test|refactor)(\([[:word:]]+\))??!?:.+$'
order: 5
- title: Others
order: 999

release:
github:
owner: line
name: lbm-sdk
prerelease: auto
mode: replace
draft: false


# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (rest) [\#807](https://github.com/line/lbm-sdk/pull/807) remove legacy REST API

### Build, CI
* (ci) [\#829](https://github.com/line/lbm-sdk/pull/829) automate release process

### Document Updates
8 changes: 8 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM tkxkd0159/goreleaserx:1.19.3
tkxkd0159 marked this conversation as resolved.
Show resolved Hide resolved

ADD https://github.com/line/wasmvm/releases/download/v1.0.0-0.10.0/libwasmvm_static.x86_64.a /lib/libwasmvm_static.x86_64.a
RUN sha256sum /lib/libwasmvm_static.x86_64.a | grep 352fa5de5f9dba66f0a38082541d3e63e21394fee3e577ea35e0906294c61276
#ADD https://github.com/line/wasmvm/releases/download/v1.0.0-0.10.0/libwasmvm_static.aarch64.a /lib/libwasmvm_static.aarch64.a
#RUN sha256sum /lib/libwasmvm_static.aarch64.a | grep bc3db72ba32f34ad88ceb1d20479411bd7f50ccd6a5ca50cc8ca462a561e6189

RUN ln -s /lib/libwasmvm_static.x86_64.a /usr/lib/libwasmvm_static.a