-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add initial github actions pipelines
added merge request pipeline and manually triggered pipeline trigger, added commitizen support
- Loading branch information
1 parent
b674cec
commit c8ecbc1
Showing
9 changed files
with
196 additions
and
3 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,8 @@ | ||
commitizen: | ||
name: cz_conventional_commits | ||
tag_format: $version | ||
version: 0.0.0 | ||
version_files: | ||
- ic-response-verification-rs/Cargo.toml:version | ||
- ic-response-verification-ts/package.json:version | ||
update_changelog_on_bump: true |
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,85 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update_changelog: | ||
name: Update Changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Commitizen | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U Commitizen | ||
- name: Check Commit Messages | ||
run: cz check --rev-range b674cec1368e57e4c73280edfced1db33ea70bb3..HEAD | ||
|
||
- name: Update Changelog | ||
run: cz changelog | ||
|
||
- name: Commit and Push changes to repository | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'chore: update changelog' | ||
commit_options: '--no-verify --signoff' | ||
file_pattern: CHANGELOG.md | ||
tagging_message: '${{ steps.cz.outputs.version }}' | ||
|
||
build_and_test_rust: | ||
name: Build and Test Rust | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Build | ||
run: | ||
working-directory: ic-response-verification-rs | ||
shell: cargo build --release | ||
|
||
- name: Test | ||
run: | ||
working-directory: ic-response-verification-rs | ||
shell: cargo test --lib | ||
|
||
- name: Lint | ||
run: | ||
working-directory: ic-response-verification-rs | ||
shell: cargo clippy | ||
|
||
- name: Check Formatting | ||
run: | ||
working-directory: ic-response-verification-rs | ||
shell: cargo fmt --all -- --check | ||
|
||
build_npm_package: | ||
name: Build NPM Package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Bazel | ||
uses: bazelbuild/setup-bazelisk@v2 | ||
|
||
- name: Setup Bazel Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: '~/.cache/bazel' | ||
key: bazel | ||
|
||
- name: Build | ||
run: bazel build //ic-response-verification-ts:lib |
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,77 @@ | ||
name: Release | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
bump_version: | ||
name: Bump version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- id: cz | ||
name: Run commitizen | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
changelog_increment_filename: RELEASE_NOTES.md | ||
commit: false | ||
|
||
- name: Print Version | ||
run: echo "Bumping to version ${{ steps.cz.outputs.version }}" | ||
|
||
- name: Update Cargo.lock | ||
run: | ||
working-directory: ic-response-verification-rs | ||
shell: cargo build | ||
|
||
- name: Update package-lock.json | ||
run: | ||
working-directory: ic-response-verification-ts | ||
shell: npm i --package-lock-only | ||
|
||
- name: Commit and Push changes to repository | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'bump: release ${{ steps.cz.outputs.version }}' | ||
commit_options: '--no-verify --signoff' | ||
file_pattern: > | ||
.cz.yaml | ||
CHANGELOG.md | ||
ic-response-verification-rs/Cargo.toml | ||
ic-response-verification-rs/Cargo.lock | ||
ic-response-verification-ts/package.json | ||
ic-response-verification-ts/package-lock.json | ||
tagging_message: '${{ steps.cz.outputs.version }}' | ||
|
||
- name: Create Cargo crate release | ||
run: | ||
working-directory: ic-response-verification-rs | ||
shell: cargo publish --dry-run | ||
|
||
- name: Create NPM package release | ||
run: | ||
working-directory: ic-response-verification-ts | ||
shell: npm pack | ||
|
||
- name: Create Github release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: > | ||
ic-response-verification-rs/target/package/ic-response-verification-${{ steps.cz.outputs.version }}.crate | ||
ic-response-verification-ts/dfinity-response-verification-${{ steps.cz.outputs.version }}.tgz | ||
bodyFile: 'RELEASE_NOTES.md' | ||
tag: '${{ steps.cz.outputs.version }}' | ||
commit: 'main' |
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 @@ | ||
repos: | ||
- hooks: | ||
- id: commitizen | ||
repo: https://github.com/commitizen-tools/commitizen | ||
rev: v2.35.0 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "ic-response-verification" | ||
version = "0.1.0" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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