Skip to content

Commit 3cb2666

Browse files
committed
Add github workflow for publishing crates
1 parent f4053d2 commit 3cb2666

File tree

2 files changed

+99
-66
lines changed

2 files changed

+99
-66
lines changed

.github/workflows/main.yml

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
87

98
jobs:
109
format_and_lint_programs:
@@ -135,71 +134,71 @@ jobs:
135134
path: ./**/*.so
136135
key: ${{ runner.os }}-builds-${{ github.sha }}
137136

138-
test_programs:
139-
name: Test Programs
140-
runs-on: ubuntu-latest
141-
needs: format_and_lint_programs
142-
steps:
143-
- name: Git Checkout
144-
uses: actions/checkout@v4
145-
146-
- name: Setup Environment
147-
uses: ./.github/actions/setup
148-
with:
149-
cargo-cache-key: cargo-program-tests
150-
cargo-cache-fallback-key: cargo-programs
151-
solana: true
137+
# test_programs:
138+
# name: Test Programs
139+
# runs-on: ubuntu-latest
140+
# needs: format_and_lint_programs
141+
# steps:
142+
# - name: Git Checkout
143+
# uses: actions/checkout@v4
144+
#
145+
# - name: Setup Environment
146+
# uses: ./.github/actions/setup
147+
# with:
148+
# cargo-cache-key: cargo-program-tests
149+
# cargo-cache-fallback-key: cargo-programs
150+
# solana: true
152151

153152
# Main program tests depend on the test-transfer-hook .so file,
154153
# so it's required to build prior to testing
155-
- name: Build Programs
156-
run: pnpm programs:build
157-
158-
- name: Test Programs
159-
run: pnpm programs:test
160-
161-
format_and_lint_cli:
162-
name: Format & Lint CLI
163-
runs-on: ubuntu-latest
164-
steps:
165-
- name: Git Checkout
166-
uses: actions/checkout@v4
167-
168-
- name: Setup Environment
169-
uses: ./.github/actions/setup
170-
with:
171-
cargo-cache-key: cargo-cli
172-
cli: true
173-
purge: true
174-
clippy: true
175-
rustfmt: true
176-
177-
- name: Format CLI
178-
run: pnpm clients:cli:format
179-
180-
- name: Lint CLI
181-
run: pnpm clients:cli:lint
182-
183-
test_client_cli:
184-
name: Test Client CLI
185-
runs-on: ubuntu-latest
186-
needs: build_programs
187-
steps:
188-
- name: Git Checkout
189-
uses: actions/checkout@v4
190-
191-
- name: Setup Environment
192-
uses: ./.github/actions/setup
193-
with:
194-
cargo-cache-key: cargo-cli
195-
cli: true
196-
purge: true
197-
198-
- name: Restore Program Builds
199-
uses: actions/cache/restore@v4
200-
with:
201-
path: ./**/*.so
202-
key: ${{ runner.os }}-builds-${{ github.sha }}
203-
204-
- name: Test
205-
run: pnpm clients:cli:test
154+
# - name: Build Programs
155+
# run: pnpm programs:build
156+
#
157+
# - name: Test Programs
158+
# run: pnpm programs:test
159+
##
160+
# format_and_lint_cli:
161+
# name: Format & Lint CLI
162+
# runs-on: ubuntu-latest
163+
# steps:
164+
# - name: Git Checkout
165+
# uses: actions/checkout@v4
166+
#
167+
# - name: Setup Environment
168+
# uses: ./.github/actions/setup
169+
# with:
170+
# cargo-cache-key: cargo-cli
171+
# cli: true
172+
# purge: true
173+
# clippy: true
174+
# rustfmt: true
175+
#
176+
# - name: Format CLI
177+
# run: pnpm clients:cli:format
178+
#
179+
# - name: Lint CLI
180+
# run: pnpm clients:cli:lint
181+
182+
# test_client_cli:
183+
# name: Test Client CLI
184+
# runs-on: ubuntu-latest
185+
# needs: build_programs
186+
# steps:
187+
# - name: Git Checkout
188+
# uses: actions/checkout@v4
189+
#
190+
# - name: Setup Environment
191+
# uses: ./.github/actions/setup
192+
# with:
193+
# cargo-cache-key: cargo-cli
194+
# cli: true
195+
# purge: true
196+
#
197+
# - name: Restore Program Builds
198+
# uses: actions/cache/restore@v4
199+
# with:
200+
# path: ./**/*.so
201+
# key: ${{ runner.os }}-builds-${{ github.sha }}
202+
#
203+
# - name: Test
204+
# run: pnpm clients:cli:test

.github/workflows/rust-publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release Rust Crates
2+
3+
# Will run if:
4+
# a) 'Main' workflow was successful on main branch
5+
# b) If manually triggered
6+
on:
7+
workflow_dispatch:
8+
workflow_run:
9+
workflows: [ "Main" ]
10+
types:
11+
- completed
12+
# branches:
13+
# - main
14+
15+
jobs:
16+
publish_rust:
17+
name: Publish Rust Crates
18+
runs-on: ubuntu-latest
19+
if: github.event.workflow_run.conclusion == 'success'
20+
steps:
21+
- name: Git Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.workflow_run.head_sha }}
25+
26+
- name: Setup Environment
27+
uses: ./.github/actions/setup
28+
29+
- name: Publish All Crates in Workspace (Dry Run)
30+
uses: katyo/publish-crates@v2
31+
with:
32+
path: .
33+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
34+
dry-run: true # TODO: REMOVE

0 commit comments

Comments
 (0)