Skip to content

Commit

Permalink
ci: Automated semantic release (#11)
Browse files Browse the repository at this point in the history
* Initialise standard linters

* Standardise PR title check

* Standardise linter

* Combine build & test

* Create codeql.yml

* Initialise releaserc files

* Update package-lock.json

* Update .gitignore

* Update .goreleaser.yaml

* Squashed commit of the following:

commit 286260b
Author: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Date:   Tue Aug 9 01:23:53 2022 +0100

    docs(readme): Add updated instructions to README (#34)

    * Update README.md

    * Update README.md

    * Update README.md

    * Update README.md

    * Update README.md

commit 9e573ec
Merge: 6ef0738 bb1fd38
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Aug 8 17:39:06 2022 +0300

    Merge pull request #22 from cheqd/dev-1582-error-codes

    feat: Add status codes [DEV-1582]

commit 6ef0738
Merge: 80ab7ae 5ae9f77
Author: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Date:   Mon Aug 8 13:43:11 2022 +0100

    ci: Add standard Dependabot workflow

commit 5ae9f77
Author: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Date:   Mon Aug 8 14:28:19 2022 +0200

    Update .gitignore

commit 9e3b2db
Author: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Date:   Mon Aug 8 14:27:34 2022 +0200

    Create dependabot.yml

commit bb1fd38
Merge: a0473af 80ab7ae
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Aug 8 11:56:41 2022 +0300

    Merge branch 'main' into dev-1582-error-codes

commit 80ab7ae
Merge: 097f9f6 4c604cb
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Aug 8 11:56:24 2022 +0300

    Merge pull request #20 from cheqd/content-types

    feat: Change supported content types [DEV-1582]

commit 097f9f6
Merge: 268afcf 8e1e130
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Aug 8 11:55:02 2022 +0300

    Merge pull request #23 from cheqd/dev-1595-metadata

    feat: Add more Resource fields to DID Doc Metadata

commit 8e1e130
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Aug 3 18:52:43 2022 +0300

    Change Checksum to hex for resource

commit a5b81e9
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Aug 2 18:35:33 2022 +0300

    fix linter issues

commit 589c550
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Aug 2 18:28:59 2022 +0300

    feat: Add Resource fields to DID Doc Metadata + tests

commit a0473af
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Aug 2 17:04:06 2022 +0300

    Add Marshalling error logging

commit 5976c3c
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 29 18:40:05 2022 +0300

    feat: Add status codes

commit 4c604cb
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 29 13:16:33 2022 +0300

    Fix linter issues

commit 4e27b79
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 29 12:40:01 2022 +0300

    Update approach of working with dereferenceOptions

commit 499f895
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 28 18:49:07 2022 +0300

    Update constants

commit 780f4d3
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 27 19:47:12 2022 +0300

    Update content types support

commit 268afcf
Merge: a60c64e 3e19261
Author: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Date:   Tue Jul 26 13:52:10 2022 +0100

    docs: Create initial README file

commit 3e19261
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 26 15:24:21 2022 +0300

    Make linter happy

commit a60c64e
Merge: 9052d67 1fc1674
Author: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Date:   Tue Jul 26 13:01:57 2022 +0100

    feat: Add resource metadata in DIDDoc metadata [DEV-1455]

    - Add basic metadata for resources under DIDDoc metadata. Please note that this is still a draft and further corrects to metadata are needed

commit 5e00081
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 26 14:00:22 2022 +0300

    Update Universal Resolver description

commit 1fc1674
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 26 13:00:03 2022 +0300

    Add ResourceURI to DID Doc metadata

commit b6b2fe4
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 22 13:57:35 2022 +0300

    lint fix

commit 83ed957
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 17:56:26 2022 +0300

    lint fix

commit 9052d67
Merge: e3a35d7 db161d5
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 13:20:31 2022 +0300

    Merge pull request #18 from cheqd/fix-resource-dereferencing

    fix: Resource dereferencing

commit bce6493
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 04:36:16 2022 +0300

    update tests

commit b63e93c
Merge: f85d327 3dc673b
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 04:20:51 2022 +0300

    Merge branch 'dereferencing-headers' into dev-1455-resources-to-metadata

commit 3dc673b
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 03:46:17 2022 +0300

    fix: resource context

commit f85d327
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 01:48:17 2022 +0300

    update tests

commit c0717b5
Merge: df0bef8 db161d5
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 01:05:33 2022 +0300

    Merge branch 'fix-resource-dereferencing' of github.com:cheqd/did-resolver into dev-1455-resources-to-metadata

commit db161d5
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 01:03:03 2022 +0300

    fix lint

commit df0bef8
Merge: 5035c9c e3a35d7
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 00:59:05 2022 +0300

    Merge branch 'main' of github.com:cheqd/did-resolver into dev-1455-resources-to-metadata

    � Conflicts:
    �	services/request_service.go
    �	services/request_service_test.go

commit 5035c9c
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 00:55:53 2022 +0300

    add metadata model

commit fa91905
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 19 00:54:13 2022 +0300

    fix: Resource dereferencing

commit 070a061
Author: Alex Tweeddale <79993234+Tweeddalex@users.noreply.github.com>
Date:   Mon Jul 18 06:05:39 2022 +0100

    Update README.md

    Made minor grammatical changes

commit d73873a
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Sat Jul 16 15:44:36 2022 +0300

    Update unit tests and dereferencing structure

commit f2dc3f3
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Sat Jul 16 12:35:33 2022 +0300

    Add resourcePreview to Metadata

commit 3fa13a7
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 15 18:22:29 2022 +0300

    Fix links

commit fdfe907
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 15 18:18:20 2022 +0300

    Add different modes description + response example

commit e3a35d7
Merge: 0d98362 bffbbc3
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 14 12:14:08 2022 +0300

    Merge pull request #14 from cheqd/resource-dereferencing

    feat: Add Resource dereferencing

commit bffbbc3
Author: Alexandr Kolesov <alexandr.kolesov@cheqd.io>
Date:   Wed Jul 13 17:26:49 2022 +0300

    Extract mustCloseGRPCConnection

commit e03e37a
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 16:00:33 2022 +0300

    update tests after merge

commit 667ca98
Merge: 7e0b68e 0d98362
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 15:45:20 2022 +0300

    Merge branch 'main' of github.com:cheqd/did-resolver into resource-dereferencing

    � Conflicts:
    �	tests/pytest/test_resolution.py

commit 7e0b68e
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 15:44:23 2022 +0300

    linter

commit df241ce
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 15:41:08 2022 +0300

    update tests, fix a bug in Resource dereferencing

commit 0d98362
Merge: 71a3c5b 07fc8b7
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 14:49:55 2022 +0300

    Merge pull request #16 from cheqd/dev-1530-http-header

    fix: Fix headers contentType behavior

commit 819813c
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 14:41:55 2022 +0300

    linter

commit 6ee5f66
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 14:02:00 2022 +0300

    Refactoring

commit 359e3e5
Merge: 2836ab5 71a3c5b
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 13:34:30 2022 +0300

    Merge branch 'main' of github.com:cheqd/did-resolver into resource-dereferencing

commit 07fc8b7
Merge: 645b062 71a3c5b
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 13:24:38 2022 +0300

    Merge branch 'main' into dev-1530-http-header

commit 71a3c5b
Merge: c147716 1ef6bbd
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Wed Jul 13 13:22:03 2022 +0300

    Merge pull request #17 from cheqd/dev-1384-integration-tests

    test: [DEV-1384] add integration tests

commit 2836ab5
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jul 12 13:57:06 2022 +0300

    Update dependencies

commit 645b062
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Jul 11 14:57:36 2022 +0300

    Add integration tests for headers

commit 4c59827
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 17:45:13 2022 +0300

    Make lint happy

commit 76e91cb
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 17:27:45 2022 +0300

    Add html support

commit 31a8bdc
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 16:12:44 2022 +0300

    Update GA test

commit 3481a3e
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 16:05:20 2022 +0300

    Update GA test

commit 2cef37e
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 15:56:11 2022 +0300

    Update tests dir name

commit 75dba01
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 15:48:12 2022 +0300

    test: Update pipelines

commit 01774a4
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 15:46:08 2022 +0300

    test: Add integration test

commit 1ef6bbd
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 16:12:44 2022 +0300

    Update GA test

commit 2215471
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 16:05:20 2022 +0300

    Update GA test

commit 874ea02
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 15:56:11 2022 +0300

    Update tests dir name

commit e2d9689
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 15:48:12 2022 +0300

    test: Update pipelines

commit 8748ea0
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Fri Jul 8 15:46:08 2022 +0300

    test: Add integration test

commit 29e50ab
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 18:42:46 2022 +0300

    fix: Fix headers contentType behavior

commit f94f567
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 14:34:14 2022 +0300

    Make linter happy

commit bb43f8a
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 13:56:32 2022 +0300

    Update tests

commit 9f34c2a
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 12:44:27 2022 +0300

    Fix linter

commit 00bbfa0
Merge: 3aaba65 d04e0fb
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 12:14:55 2022 +0300

    Merge branch 'resource-dereferencing' of github.com:cheqd/did-resolver into resource-dereferencing

commit 3aaba65
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 12:14:35 2022 +0300

    Fix linter

commit d04e0fb
Merge: 18b6b7a c147716
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 11:58:47 2022 +0300

    Merge branch 'main' into resource-dereferencing

commit 18b6b7a
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 11:58:07 2022 +0300

    Fix request_service_test

commit da2ac42
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jul 7 11:34:09 2022 +0300

    Add ordered maps, update tests

commit 68feb03
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Thu Jun 30 17:08:45 2022 +0300

    update models

commit ea08dad
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Tue Jun 28 19:45:50 2022 +0300

    add unit tests

commit 6d9bb4b
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Jun 27 19:46:09 2022 +0300

    Add did url utils

commit 9bb5beb
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Jun 27 19:45:48 2022 +0300

    Add Resource dereferencing

commit c147716
Merge: 45f78ea 447d17b
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Jun 27 18:12:40 2022 +0300

    Merge pull request #12 from cheqd/fix_compose

    fix: Fix HOME directory passing

commit 447d17b
Author: Andrew Nikitin <andrew.nikitin@cheqd.io>
Date:   Mon Jun 27 18:09:57 2022 +0300

    Remove unused 443 port forwarding

commit 45f78ea
Merge: 08288d9 a08f052
Author: toktar <renata.toktar@dsr-corporation.com>
Date:   Mon Jun 27 18:09:14 2022 +0300

    Merge pull request #13 from cheqd/ca-certificates

    fix: Fix timeouts inside docker container

commit a08f052
Author: Alexandr Kolesov <alexandr.kolesov@dsr-corporation.com>
Date:   Fri Jun 24 17:57:43 2022 +0300

    fix: Fix timeouts inside docker container

commit c744bf2
Author: Andrew Nikitin <andrew.nikitin@evernym.com>
Date:   Fri Jun 24 11:04:01 2022 +0300

    fix: Fix HOME directory passing

    Signed-off-by: Andrew Nikitin <andrew.nikitin@evernym.com>

commit 4beb6af
Author: Tweeddalex <79993234+Tweeddalex@users.noreply.github.com>
Date:   Wed May 25 02:54:57 2022 +0100

    Updated readme

commit 2d5b2d5
Author: Tweeddalex <79993234+Tweeddalex@users.noreply.github.com>
Date:   Wed May 25 02:46:29 2022 +0100

    Started ReadMe to be filled in

* Add .goreleaser

Signed-off-by: Andrew Nikitin <andrew.nikitin@evernym.com>

* Add goreleaser

* Add goreleaser

* Delete test.yml

* Update dispatch.yml

* Update .releaserc.json

* Uncomment branch protection

* Update release.yml

* Update .goreleaser.yml

* Update .goreleaser.yml

* Update .releaserc.json

* Update package.json

* Update package-lock.json

* Update package.json

* Update package-lock.json

* Update release.yml

* Update .goreleaser.yml

* Update dispatch.yml

Co-authored-by: Andrew Nikitin <andrew.nikitin@evernym.com>
  • Loading branch information
ankurdotb and Andrew Nikitin committed Aug 9, 2022
1 parent 286260b commit b3e8f25
Show file tree
Hide file tree
Showing 15 changed files with 10,089 additions and 133 deletions.
6 changes: 3 additions & 3 deletions .github/linters/.commitlint.rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ module.exports = {
'always',
['sentence-case'],
],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'subject-empty': [1, 'never'],
'subject-full-stop': [1, 'never', '.'],
'header-max-length': [2, 'always', 100],
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 100],
'body-max-line-length': [2, 'always', 1000],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 100],
},
Expand Down
18 changes: 18 additions & 0 deletions .github/linters/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"node": true,
"jest/globals": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {}
}
2 changes: 1 addition & 1 deletion .github/linters/mlc_config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"aliveStatusCodes": [0, 200, 206, 999]
"aliveStatusCodes": [0, 200, 206, 403, 999]
}
29 changes: 23 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
name: "Build"
on:
workflow_call:
name: "Build & Test"
on: workflow_call
defaults:
run:
shell: bash

jobs:

check-building:
name: "Check binary build"
golang-tests:
name: "Golang Tests"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '1.17'

- name: Run Golang build
- name: "Run Golang unit tests"
run: go test -v ./...

golang-build:
name: "Golang Build"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '1.17'

- name: "Run Golang build"
run: go build main.go

try-docker-build:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "CodeQL"
on:
push:
branches:
- main
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash


jobs:

codeql-analysis:
name: "CodeQL Analysis"
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version

- uses: actions/setup-go@v3
with:
go-version: '1.17'

- name: Setup CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'go'
queries: security-and-quality

- name: Build
run: |
go build main.go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
15 changes: 5 additions & 10 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@ jobs:
uses: ./.github/workflows/lint.yml

call-build:
name: "Build"
name: "Build & Test"
needs: call-lint
uses: ./.github/workflows/build.yml

call-test:
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')
needs: call-build
if: ${{ github.ref_protected == true }}
uses: ./.github/workflows/release.yml
with:
RELEASE_VERSION: ${GITHUB_REF_NAME}
secrets: inherit

6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
go-lint:
# We can't use VALIDATE_GO from super linter because of this issue:
# https://github.com/github/super-linter/issues/143
name: "Golang"
name: "Golang Lint"
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -65,16 +65,16 @@ jobs:
env:
IGNORE_GITIGNORED_FILES: true
DEFAULT_BRANCH: main
LINTER_RULES_PATH: '.github/linters'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_LEVEL: WARN
VALIDATE_ALL_CODEBASE: true
MULTI_STATUS: true

VALIDATE_BASH: true
VALIDATE_DOCKERFILE_HADOLINT: true
DOCKERFILE_HADOLINT_FILE_NAME: '../linters/.hadolint.yml'
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_JSON: true
VALIDATE_JSONC: true
VALIDATE_MARKDOWN: true
VALIDATE_OPENAPI: true
VALIDATE_XML: true
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: PR Title Check
name: "PR Title Check"
on:
pull_request_target:
branches:
- main
- 'release/**'
- develop
types:
- opened
- reopened
- edited
- synchronize
- ready_for_review
- review_requested

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-pr:
name: "PR format check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -25,6 +28,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# to override config-conventional rules, specify a relative path to your rules module, actions/checkout is required for this setting!
commitlintRulesPath: ".github/linters/.commitlint.rules.js" # default: undefined
commitlintRulesPath: "./.github/linters/.commitlint.rules.js" # default: undefined
# if the PR contains a single commit, fail if the commit message and the PR title do not match
commitTitleMatch: "false" # default: 'true'
71 changes: 26 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,47 @@
name: "Release"
on:
workflow_call:
inputs:
RELEASE_VERSION:
description: "Release version number"
required: true
type: string
defaults:
run:
shell: bash
permissions:
contents: write
packages: write


jobs:
make-release:

release-binary:
name: "Release Binary"
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ inputs.RELEASE_VERSION }}
REGISTRY: ghcr.io

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Login to Container registry
uses: docker/login-action@v1
- uses: actions/setup-go@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
go-version: '1.17'

- name: Download resolver Docker image
uses: actions/download-artifact@v3
# Node.js setup is needed to run Semantic Release
- uses: actions/setup-node@v3
with:
name: cheqd-did-resolver.tar
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Load resolver Docker image
run: |
docker load -i cheqd-did-resolver.tar
rm cheqd-did-resolver.tar
- name: "Obtain Github App token"
id: app-token
uses: getsentry/action-github-app-token@v1.0.6
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_APP_PRIVATE_KEY }}

- 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: "Install Semantic Release dependencies"
run: npm ci

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
version: latest
args: release --rm-dist
- name: "Execute Semantic Release"
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets
uses: actions/upload-artifact@v2
with:
name: did-resolver
path: dist/*
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
50 changes: 0 additions & 50 deletions .github/workflows/test.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .goreleaser.yaml

This file was deleted.

Loading

0 comments on commit b3e8f25

Please sign in to comment.