Skip to content

Commit

Permalink
ci: Introduce release-plz to automate release process (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
frol authored Oct 8, 2023
1 parent 9775eb2 commit 5f63911
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/test.yml → .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Checkout Sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get MSRV
run: |
Expand All @@ -23,6 +23,7 @@ jobs:
with:
profile: minimal
toolchain: ${{ env.RUST_MSRV }}
default: true

- run: cargo check

Expand All @@ -31,7 +32,7 @@ jobs:

steps:
- name: Checkout Sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run Tests
run: cargo test
Expand All @@ -41,7 +42,7 @@ jobs:

steps:
- name: Checkout Sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check Formatting
run: cargo fmt -- --check
Expand All @@ -54,7 +55,7 @@ jobs:

steps:
- name: Checkout Sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install json-schema-compatibility-checker
run: |
Expand All @@ -68,4 +69,23 @@ jobs:
run: diff tmp.json metaschema/near-abi-current-schema.json

- name: Check that Meta-schema is Backward Compatible
run: pip install semver && python .github/check_metaschema_compatibility.py
run: pip install semver && python .github/check_metaschema_compatibility.py

release-plz:
runs-on: ubuntu-latest
needs: [msrv-check, tests, lint, check-metaschema]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
env:
# https://release-plz.ieni.dev/docs/github/trigger
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ members = [
"near-abi",
"metaschema"
]
resolver = "2"
2 changes: 1 addition & 1 deletion near-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "near-abi"
version = "0.4.0"
edition = "2021"
rust-version = "1.56.0"
rust-version = "1.66.0"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/near/near-abi-rs"
Expand Down

0 comments on commit 5f63911

Please sign in to comment.