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

Add release workflow #57

Merged
merged 43 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
19698b9
add workflow setting
mist714 Oct 12, 2022
400d712
add build
mist714 Oct 12, 2022
f623a9c
bump version
mist714 Oct 12, 2022
0c77f0e
add prefix
mist714 Oct 12, 2022
99d7a62
use prefix
mist714 Oct 12, 2022
9d20f77
add release
mist714 Oct 12, 2022
860774b
delete PR
mist714 Oct 12, 2022
8be8823
install github-release
mist714 Oct 12, 2022
2d7cb07
fix
mist714 Oct 12, 2022
c6e61da
fix
mist714 Oct 12, 2022
fa07ae8
fix version
mist714 Oct 12, 2022
852a298
fix version
mist714 Oct 12, 2022
59f4c86
revert makefil
mist714 Oct 12, 2022
a3e48a3
only COPY
mist714 Oct 12, 2022
18aceb7
revert Dockerfile
mist714 Oct 12, 2022
d5bd804
add new Dockerfile
mist714 Oct 12, 2022
cfad4e5
rm arm image
mist714 Oct 12, 2022
4144cd6
use push to dev
mist714 Oct 12, 2022
d02516a
use push to dev
mist714 Oct 12, 2022
bc83ee2
skip-publish
mist714 Oct 12, 2022
ce0b6d9
revive arm
mist714 Oct 12, 2022
9e8a5cd
use ubuntu
mist714 Oct 12, 2022
0223c46
fix
mist714 Oct 12, 2022
d1f1400
introduce qemu
mist714 Oct 12, 2022
0a3f19b
sign
mist714 Oct 12, 2022
a6a7e39
Update Dockerfile
mist714 Oct 12, 2022
81bf77b
Merge branch 'release-flow' of github.com:pfnet-research/git-ghost in…
mist714 Oct 12, 2022
3b56462
rm options
mist714 Oct 12, 2022
49546c1
Apply suggestions from code review
mist714 Oct 12, 2022
4ea650d
fix conflict
mist714 Oct 12, 2022
89bc989
update readme
mist714 Oct 12, 2022
d276360
update readme
mist714 Oct 12, 2022
71a410a
sign
mist714 Oct 12, 2022
a936b7b
rm VERSION and env
mist714 Oct 12, 2022
ff69782
Update .goreleaser.yml
mist714 Oct 12, 2022
3839df1
rm guard and revive CGO
mist714 Oct 12, 2022
6fca208
delete Dockerfile
mist714 Oct 13, 2022
d60da76
fix examples
mist714 Oct 13, 2022
962102e
Update release.yml
mist714 Oct 13, 2022
4527df0
use latest
mist714 Oct 13, 2022
034d299
Merge branch 'release-flow' of github.com:pfnet-research/git-ghost in…
mist714 Oct 13, 2022
0be9ba4
Update .goreleaser.yml
mist714 Oct 13, 2022
79b6bad
fix image name
mist714 Oct 13, 2022
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
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
tags: ["v*"]

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ~1.19
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: pfnet-research
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: v1.11.5
args: release --rm-dist --snapshot --skip-publish --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

58 changes: 58 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
before:
hooks:
- go mod download
builds:
- id: git-ghost
binary: git-ghost
env:
- CGO_ENABLED=0
- GO_VERSION=1.19
goos:
- linux
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.Version={{.Version}}

dockers:
- image_templates: ["ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}-amd64"]
dockerfile: release.Dockerfile
goarch: amd64
use: buildx
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/pfnet-research/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/pfnet-research/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .ShortCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0
- image_templates: ["ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}-arm64v8"]
dockerfile: release.Dockerfile
goarch: arm64
use: buildx
build_flag_templates:
- --platform=linux/arm64/v8
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/pfnet-research/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/pfnet-research/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .ShortCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0

docker_manifests:
- name_template: ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}
image_templates:
- ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}-arm64v8
- name_template: ghcr.io/pfnet-research/{{ .ProjectName }}:latest
image_templates:
- ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/pfnet-research/{{ .ProjectName }}:{{ .Version }}-arm64v8

release:
prerelease: auto
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.4
v0.1.5
3 changes: 3 additions & 0 deletions release.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.15.2
RUN apk add --no-cache git ca-certificates openssh-client
COPY git-ghost /usr/local/bin/