-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from iosis-tech/cli_crates_io_auto_publish
CI/CD crates.io & docker auto publish
- Loading branch information
Showing
12 changed files
with
1,194 additions
and
35 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,36 @@ | ||
# Ignore the entire target directory, as it's used for build artifacts | ||
/target | ||
|
||
# Ignore any generated documentation | ||
/doc | ||
|
||
# Ignore temporary files | ||
*.rs.bk | ||
*.rs.swp | ||
*.rs.swo | ||
|
||
# Ignore build scripts output | ||
/build.rs | ||
|
||
# Ignore files for specific editors or IDEs | ||
*.iml | ||
*.idea | ||
.vscode | ||
*.swp | ||
|
||
# Ignore OS generated files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Ignore backup and log files | ||
*.log | ||
*.bak | ||
*.tmp | ||
*.old | ||
*.swp | ||
|
||
# Ignore git-related files | ||
.git | ||
.gitignore | ||
|
||
Dockerfile |
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,61 @@ | ||
name: Manual Publish to Crates.io | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
WORKING_DIR: ${{ github.workspace }} | ||
WORKING_DIR_CLI: ${{ github.workspace }}/cli | ||
WORKING_DIR_PROOF_PARSER: ${{ github.workspace }}/proof_parser | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Cache Cargo registry | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-registry- | ||
- name: Cache Cargo build | ||
uses: actions/cache@v2 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-build- | ||
- name: Install dependencies | ||
run: cargo fetch | ||
|
||
- name: Run tests | ||
run: cargo test --all | ||
|
||
- name: Publish crates to crates.io | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | ||
run: | | ||
cargo publish -p swiftness_transcript --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml | ||
cargo publish -p swiftness_pow --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml | ||
cargo publish -p swiftness_commitment --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml | ||
cargo publish -p swiftness_fri --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml | ||
cargo publish -p swiftness_air --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml | ||
cargo publish -p swiftness_stark --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml | ||
cargo publish -p swiftness_proof_parser --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR_PROOF_PARSER }}/Cargo.toml | ||
cargo publish -p swiftness --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR_CLI }}/Cargo.toml |
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,53 @@ | ||
name: Publish Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Docker image version" | ||
required: true | ||
default: "latest" | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
layout: | ||
[ | ||
"dex", | ||
"recursive", | ||
"recursive_with_poseidon", | ||
"small", | ||
"starknet", | ||
"starknet_with_keccak", | ||
] | ||
hash: ["blake2s", "keccak"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: latest | ||
driver: docker-container | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: runtime.dockerfile | ||
tags: "okm165/swiftness:${{ github.event.inputs.version }}" | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
build-args: | | ||
FEATURES=${{ matrix.layout }},${{ matrix.hash }} |
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 was deleted.
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
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.