-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #444 from rjonczy/develop
Releasing artifacts: with goreleaser
- Loading branch information
Showing
12 changed files
with
299 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: goreleaser-latest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
goreleaser-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Release (snapshot) | ||
run: make release-snapshot | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to GHCR container register | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push versioned image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: contrib/docker/goreleaser.Dockerfile | ||
context: . | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/composablefi/composable-cosmos:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Release | ||
run: make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get version | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Login to GHCR container register | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push versioned image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: contrib/docker/goreleaser.Dockerfile | ||
context: . | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: | | ||
ghcr.io/composablefi/composable-cosmos:${{ steps.get_version.outputs.version }} | ||
ghcr.io/composablefi/composable-cosmos:v${{ steps.get_version.outputs.major }} | ||
ghcr.io/composablefi/composable-cosmos:v${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ scripts/temp.sh | |
wasm_client* | ||
vue/* | ||
bin/* | ||
|
||
dist/ | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# .goreleaser.yml | ||
|
||
project_name: centaurid | ||
|
||
env: | ||
- CGO_ENABLED=1 | ||
|
||
builds: | ||
- id: linux | ||
main: ./cmd/centaurid | ||
binary: centaurid | ||
hooks: | ||
pre: | ||
- cmd: bash scripts/release_pre_linux.sh | ||
output: false # enable for debug | ||
env: | ||
- TARGET={{ .Target }} | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
env: | ||
- CC_linux_amd64=x86_64-linux-gnu-gcc | ||
- CC_linux_arm64=aarch64-linux-gnu-gcc | ||
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' | ||
flags: | ||
- -mod=readonly | ||
- -trimpath | ||
ldflags: | ||
- -X github.com/cosmos/cosmos-sdk/version.Name=centauri | ||
- -X github.com/cosmos/cosmos-sdk/version.AppName=centaurid | ||
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} | ||
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} | ||
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc" | ||
- -w -s | ||
- -linkmode=external | ||
- -extldflags '-static -lm -lbz2' | ||
tags: | ||
- netgo | ||
- ledger | ||
- muslc | ||
- static | ||
- static_wasm | ||
|
||
# - id: darwin | ||
# main: ./cmd/centaurid | ||
# binary: centaurid | ||
# hooks: | ||
# pre: | ||
# - cmd: bash scripts/release_pre_darwin.sh | ||
# output: false # enable for debug | ||
# env: | ||
# - TARGET={{ .Target }} | ||
# goos: | ||
# - darwin | ||
# goarch: | ||
# - amd64 | ||
# - arm64 | ||
# env: | ||
# - CC_darwin_amd64=o64-clang | ||
# - CC_darwin_arm64=oa64-clang | ||
# - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' | ||
# flags: | ||
# - -mod=readonly | ||
# - -trimpath | ||
# ldflags: | ||
# - -X github.com/cosmos/cosmos-sdk/version.Name=centauri | ||
# - -X github.com/cosmos/cosmos-sdk/version.AppName=centaurid | ||
# - -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} | ||
# - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} | ||
# - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc" | ||
# - -w -s | ||
# - -linkmode=external | ||
# - -extldflags '-static -lm -lbz2' | ||
# tags: | ||
# - netgo | ||
# - ledger | ||
# - muslc | ||
# - static | ||
# - static_wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM golang:1.20 AS builder | ||
|
||
WORKDIR /root | ||
COPY ./dist/ /root/ | ||
|
||
ARG TARGETARCH | ||
RUN if [ "${TARGETARCH}" = "arm64" ]; then \ | ||
cp linux_linux_arm64/centaurid /root/centaurid; \ | ||
else \ | ||
cp linux_linux_amd64_v1/centaurid /root/centaurid; \ | ||
fi | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk --no-cache add ca-certificates jq | ||
COPY --from=builder /root/centaurid /usr/local/bin/centaurid | ||
|
||
RUN addgroup --gid 1025 -S composable && adduser --uid 1025 -S composable -G composable | ||
|
||
WORKDIR /home/composable | ||
USER composable | ||
|
||
# rest server | ||
EXPOSE 1317 | ||
# tendermint p2p | ||
EXPOSE 26656 | ||
# tendermint rpc | ||
EXPOSE 26657 | ||
# grpc | ||
EXPOSE 9090 | ||
|
||
ENTRYPOINT ["centaurid"] | ||
CMD [ "start" ] |
Oops, something went wrong.