Skip to content

Commit 571e997

Browse files
committed
fix Gravity for forks (hopefully)
1 parent a2fca4c commit 571e997

2 files changed

Lines changed: 39 additions & 12 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 Release Artifacts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
build:
11+
name: Build
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@v2
19+
with:
20+
name: artifacts
21+
path: |
22+
./target/release/gerust
23+
./target/package/gerust-*.crate

.github/workflows/gravity.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
name: Gravity
1+
name: Build Release Artifacts
22

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

99
jobs:
1010
build:
11-
name: Run Gravity
11+
name: Gravity
1212
runs-on: ubuntu-latest
13-
if: github.repository == 'mainmatter/gerust'
13+
if: >
14+
github.event.workflow_run.event == 'pull_request' &&
15+
github.event.workflow_run.conclusion == 'success'
1416
steps:
1517
- uses: actions/checkout@v4
1618
- uses: pnpm/action-setup@v4
1719
with:
1820
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
21+
- uses: actions/upload-artifact@v2
22+
with:
23+
name: artifacts
24+
path: artifacts
25+
- run: pnpm dlx @gravityci/cli "artifacts" # keep track of the sizes of both the .crate file as well as the binary
2326
env:
24-
GRAVITY_TOKEN: ${{ secrets.GRAVITY_TOKEN }}
27+
GRAVITY_SHA: ${{ github.event.workflow_run.head_sha }}
28+
GRAVITY_TOKEN: ${{ secrets.GRAVITY_TOKEN }}

0 commit comments

Comments
 (0)