Skip to content

Commit 441ac0f

Browse files
committed
fix Gravity for forks
1 parent dab9273 commit 441ac0f

2 files changed

Lines changed: 37 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
build:
11+
name: Build Release Artifacts
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions-rust-lang/setup-rust-toolchain@v1
16+
- run: cargo publish --dry-run
17+
- run: cargo build -r
18+
- uses: actions/upload-artifact@v4
19+
with:
20+
name: artifacts
21+
path: |
22+
./target/release/gerust
23+
./target/package/gerust-*.crate

.github/workflows/gravity.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
name: Gravity
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request: {}
4+
workflow_run:
5+
workflows: ["Build"]
6+
types:
7+
- completed
88

99
jobs:
10-
build:
10+
gravity:
1111
name: Run Gravity
1212
runs-on: ubuntu-latest
13-
if: github.repository == 'mainmatter/gerust'
13+
if: >
14+
github.event.workflow_run.conclusion == 'success'
1415
steps:
1516
- uses: actions/checkout@v4
1617
- uses: pnpm/action-setup@v4
1718
with:
1819
version: 10
19-
- uses: actions-rust-lang/setup-rust-toolchain@v1
20-
- run: cargo publish --dry-run
21-
- run: cargo build -r
22-
- run: pnpm dlx @gravityci/cli "./target/release/gerust" "./target/package/gerust-*.crate" # keep track of the sizes of both the .crate file as well as the binary
20+
- uses: actions/download-artifact@v5
21+
with:
22+
name: artifacts
23+
path: artifacts
24+
- run: pnpm dlx @gravityci/cli "artifacts" # keep track of the sizes of both the .crate file as well as the binary
2325
env:
24-
GRAVITY_TOKEN: ${{ secrets.GRAVITY_TOKEN }}
26+
GRAVITY_SHA: ${{ github.event.workflow_run.head_sha }}
27+
GRAVITY_TOKEN: ${{ secrets.GRAVITY_TOKEN }}

0 commit comments

Comments
 (0)