-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WORKFLOW] Add CI and release workflows
- Loading branch information
Kleonikos Kyriakis
committed
May 24, 2024
1 parent
0b0967f
commit 00225d8
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
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,5 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
git update-index --really-refresh >> /dev/null | ||
git diff-index --quiet HEAD |
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: CI | ||
|
||
on: | ||
pull_request: | ||
tags-ignore: ["*"] | ||
branches: [c4t, dev] | ||
push: | ||
branches: [c4t, dev] | ||
workflow_dispatch: | ||
|
||
# Cancel ongoing workflow runs if a new one is started | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
go_version: '~1.20.12' | ||
|
||
jobs: | ||
unit: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Update dependencies | ||
run: git submodule update --init | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go_version }} | ||
- name: build | ||
shell: bash | ||
run: ./scripts/build.sh | ||
go_mod_tidy: | ||
name: Check state of go.mod and go.sum | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Update dependencies | ||
run: git submodule update --init | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go_version }} | ||
- name: Go Mod Tidy | ||
shell: bash | ||
run: go mod tidy | ||
- name: Check Clean Branch | ||
shell: bash | ||
run: .github/workflows/check-clean-branch.sh | ||
|
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 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
ci: | ||
uses: ./.github/workflows/ci.yml | ||
release: | ||
name: Release | ||
needs: [ci] | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: cd signavaultjs | ||
run: cd signavaultjs | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build library | ||
run: yarn build | ||
- name: Create .npmrc | ||
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc | ||
- name: Release | ||
run: npm publish |