Skip to content

Commit

Permalink
build: add CI release automation (#392)
Browse files Browse the repository at this point in the history
Resolves #391
  • Loading branch information
bidzyyys authored Nov 6, 2024
1 parent a8796a7 commit f223c67
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Check Links
# Because of that, we use linkspector for adoc files and lychee for md files.
on:
push:
branches: [ main, v* ]
branches: [ main, v*, release/* ]
pull_request:
branches: [ main, v* ]
branches: [ main, v*, release/* ]

jobs:
check-links-md:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ permissions:
contents: read
on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
branches: [ main, release/* ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
contents: read
on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
# main branch ensures that the PR only gets built once.
on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
# If new code is pushed to a PR branch, then cancel in progress workflows for
# that PR. Ensures that we don't waste CI time, and returns results quicker.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
contents: read
on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gas-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
contents: read
on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:
contents: read
on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/publish-motsu-proc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: publish motsu-proc
# This workflow publishes motsu-proc on crates.io.
permissions:
contents: read
on:
workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check-publish:
name: Publish motsu-proc on crates.io
env:
MOTSU_PROC_TOKEN: ${{ secrets.MOTSU_PROC_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""

- name: Check motsu-proc
run: cargo publish -p motsu-proc --dry-run

- name: Publish motsu-proc
run: cargo publish -p motsu-proc --token $MOTSU_PROC_TOKEN
30 changes: 30 additions & 0 deletions .github/workflows/publish-motsu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: publish motsu
# This workflow publishes motsu on crates.io.
permissions:
contents: read
on:
workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check-publish:
name: Publish motsu on crates.io
env:
MOTSU_TOKEN: ${{ secrets.MOTSU_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""

- name: Check motsu
run: cargo publish -p motsu --dry-run

- name: Publish motsu
run: cargo publish -p motsu --token $MOTSU_TOKEN
32 changes: 32 additions & 0 deletions .github/workflows/publish-openzeppelin-crypto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: publish openzeppelin-crypto
# This workflow publishes openzeppelin-crypto on crates.io.
permissions:
contents: read
on:
push:
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check-publish:
name: Publish openzeppelin-crypto on crates.io
env:
OPENZEPPELIN_CRYPTO_TOKEN: ${{ secrets.OPENZEPPELIN_CRYPTO_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""

- name: Check openzeppelin-crypto
run: cargo publish -p openzeppelin-crypto --target wasm32-unknown-unknown --dry-run

- name: Publish openzeppelin-crypto
run: cargo publish -p openzeppelin-crypto --target wasm32-unknown-unknown --token $OPENZEPPELIN_CRYPTO_TOKEN
30 changes: 30 additions & 0 deletions .github/workflows/publish-openzeppelin-stylus-proc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: publish openzeppelin-stylus-proc
# This workflow publishes openzeppelin-stylus-proc on crates.io.
permissions:
contents: read
on:
workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check-publish:
name: Publish openzeppelin-stylus-proc on crates.io
env:
OPENZEPPELIN_STYLUS_PROC_TOKEN: ${{ secrets.OPENZEPPELIN_STYLUS_PROC_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""

- name: Check openzeppelin-stylus-proc
run: cargo publish -p openzeppelin-stylus-proc --target wasm32-unknown-unknown --dry-run

- name: Publish openzeppelin-stylus-proc
run: cargo publish -p openzeppelin-stylus-proc --target wasm32-unknown-unknown --token $OPENZEPPELIN_STYLUS_PROC_TOKEN
32 changes: 32 additions & 0 deletions .github/workflows/publish-openzeppelin-stylus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: publish openzeppelin-stylus
# This workflow publishes openzeppelin-stylus on crates.io.
permissions:
contents: read
on:
push:
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check-publish:
name: Publish openzeppelin-stylus on crates.io
env:
OPENZEPPELIN_STYLUS_TOKEN: ${{ secrets.OPENZEPPELIN_STYLUS_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""

- name: Check openzeppelin-stylus
run: cargo publish -p openzeppelin-stylus --target wasm32-unknown-unknown --dry-run

- name: Publish openzeppelin-stylus
run: cargo publish -p openzeppelin-stylus --target wasm32-unknown-unknown --token $OPENZEPPELIN_STYLUS_TOKEN
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
contents: read
on:
push:
branches: [ main ]
branches: [ main, release/* ]
paths-ignore:
- "**.md"
- "**.adoc"
Expand Down

0 comments on commit f223c67

Please sign in to comment.