Skip to content

Commit

Permalink
Add goreleaser config
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Nikitin <andrew.nikitin@cheqd.io>
  • Loading branch information
Andrew Nikitin committed May 20, 2022
1 parent a9dbf3e commit 1675081
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
# if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/release.yml
with:
RELEASE_VERSION: 1.0.0
RELEASE_VERSION: "1.0.0"
68 changes: 38 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,59 @@ defaults:


jobs:
go-releaser:
make-release:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ inputs.RELEASE_VERSION }}
REGISTRY: ghcr.io
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2

- name: Login to Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
version: ${{ env.RELEASE_VERSION }}
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-docker:
name: "Publish Docker images"
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ inputs.VERSION }}
REGISTRY: ghcr.io

steps:
- name: Download resolver Docker image
uses: actions/download-artifact@v3
with:
name: cheqd-did-resolver.tar

- name: Load resolver Docker image
run: docker load -i cheqd-did-resolver.tar
# - name: Download resolver Docker image
# uses: actions/download-artifact@v3
# with:
# name: cheqd-did-resolver.tar
#
# - name: Load resolver Docker image
# run: docker load -i cheqd-did-resolver.tar
#

- name: Login to Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Push cheqd-node image
# run: |
# docker tag cheqd-did-resolver ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}
# docker tag cheqd-did-resolver ghcr.io/${{ github.repository }}:latest
# docker push ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}
# docker push ghcr.io/${{ github.repository }}:latest

- name: Push cheqd-node image
run: |
docker tag cheqd-did-resolver ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}
docker tag cheqd-did-resolver ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}
docker push ghcr.io/${{ github.repository }}:latest
# - uses: "marvinpinto/action-automatic-releases@latest"
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "${{ env.GITHUB_REF_NAME }}"
# prerelease: true
# draft: true
# files: |
#
# cheqd-noded
13 changes: 13 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project_name: example
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
dockers:
- image_templates: ["ghcr.io/cheqd/did-resolver:{{ .Version }}"]
dockerfile: docker/Dockerfile

0 comments on commit 1675081

Please sign in to comment.