Skip to content

Commit

Permalink
refactor: Prepare for being public
Browse files Browse the repository at this point in the history
refactor: Prepare for being public
  • Loading branch information
ankurdotb committed May 20, 2022
2 parents 323d835 + 46dfcce commit 08288d9
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,13 @@ jobs:

- name: Check docker building
working-directory: .
run: docker build -f docker/Dockerfile .
run: docker build -f docker/Dockerfile -t cheqd-did-resolver .

- name: Save cheqd-did-resolver Docker image
run: docker save -o cheqd-did-resolver.tar cheqd-did-resolver

- name: Store cheqd-did-resolver artifact
uses: actions/upload-artifact@v3
with:
name: cheqd-did-resolver.tar
path: cheqd-did-resolver.tar
8 changes: 8 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ jobs:
name: "Tests"
needs: call-build
uses: ./.github/workflows/test.yml

call-release:
name: "Release"
needs: [call-test, call-build]
if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/release.yml
with:
RELEASE_VERSION: ${GITHUB_REF_NAME}
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Release"
on:
workflow_call:
inputs:
RELEASE_VERSION:
description: "Release version number"
required: true
type: string
defaults:
run:
shell: bash


jobs:
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: 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
rm cheqd-did-resolver.tar
- 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: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets
uses: actions/upload-artifact@v2
with:
name: did-resolver
path: dist/*
11 changes: 11 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
release:
prerelease: "true"
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64

0 comments on commit 08288d9

Please sign in to comment.