-
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.
- Loading branch information
Showing
26 changed files
with
1,160 additions
and
312 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,28 @@ | ||
name: Testing the application | ||
run-name: MTNMomo Test | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Install nitghly | ||
run: | | ||
rustup install nightly | ||
rustup default nightly | ||
- name: Install cargo-make | ||
run: cargo test | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
tag=$(git describe --tags --abbrev=0) | ||
gh release create $tag ./target/release/* |
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,24 @@ | ||
name: Publish to crates.io | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Build and publish | ||
run: | | ||
rustup install nightly | ||
cargo login ${{ secrets.BNATOKEN }} | ||
cargo publish --token ${{ secrets.BNATOKEN }} | ||
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,4 +1,7 @@ | ||
/target | ||
.env | ||
Cargo.lock | ||
node_modules | ||
node_modules | ||
collection_access_tokens.db | ||
disbursement_access_tokens.db | ||
remittance_access_tokens.db |
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
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,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Read the current version from Cargo.toml | ||
current_version=$(jq -r '.package.version' Cargo.toml) | ||
|
||
# Increment the version (assuming semantic versioning) | ||
new_version=$(echo $current_version | awk -F. '{$NF = $NF + 1;} 1' OFS=.) | ||
|
||
# Update Cargo.toml with the new version | ||
jq --arg new_version "$new_version" '.package.version = $new_version' Cargo.toml > Cargo.toml.tmp | ||
mv Cargo.toml.tmp Cargo.toml | ||
|
||
# Commit the changes | ||
git add Cargo.toml | ||
git commit -m "Bump version to $new_version" | ||
|
||
# Tag the commit | ||
git tag $new_version | ||
|
||
# Push changes and tags to the repository | ||
git push origin main # Change 'main' to your branch name if it's different | ||
git push origin $new_version |
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
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,20 @@ | ||
use std::fmt; | ||
|
||
use serde::{Serialize, Deserialize}; | ||
|
||
|
||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] | ||
pub enum AccessType { | ||
Online, | ||
Offline, | ||
} | ||
|
||
|
||
impl fmt::Display for AccessType { | ||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
match *self { | ||
AccessType::Online => write!(f, "online"), | ||
AccessType::Offline => write!(f, "offline"), | ||
} | ||
} | ||
} |
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
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,2 +1,3 @@ | ||
pub mod currency; | ||
pub mod environment; | ||
pub mod environment; | ||
pub mod access_type; |
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
Oops, something went wrong.