Skip to content

Commit 41695a2

Browse files
committed
chore(CI): add pre-release on tag - uploads wasm files as assets
1 parent 6b17d9e commit 41695a2

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

.github/workflows/rust-host.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@ name: rust-host
22
on: [push, pull_request]
33

44
jobs:
5+
# https://github.com/marketplace/actions/skip-duplicate-actions
6+
pre_job:
7+
# continue-on-error: true # Uncomment once integration is finished
8+
runs-on: ubuntu-latest
9+
# Map a step output to a job output
10+
outputs:
11+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
12+
steps:
13+
- id: skip_check
14+
uses: fkirc/skip-duplicate-actions@v5
15+
with:
16+
# All of these options are optional, so you can remove them if you are happy with the defaults
17+
# Skip a workflow run if the same workflow is already running
18+
concurrent_skipping: 'same_content_newer'
19+
skip_after_successful_duplicate: 'true'
20+
paths_ignore: '["**/README.md"]'
21+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
522
build-and-test:
23+
needs: pre_job
24+
if: needs.pre_job.outputs.should_skip != 'true'
625
runs-on: ubuntu-latest
726
steps:
827
- name: Set variables based on OS and architecture for just dl-wasi-sdk
@@ -43,3 +62,35 @@ jobs:
4362
run: just test
4463
- name: Test with wasm from http server (if it fails, you need to publish a new version of pluginlab)
4564
run: just test-e2e-pluginlab-http
65+
66+
- name: Build plugins in release mode (for pre-release)
67+
if: github.ref_type == 'tag'
68+
run: just build-plugins-release
69+
- name: Prepare wasm files (for pre-release)
70+
if: github.ref_type == 'tag'
71+
run: ./scripts/prepare-wasm-files.sh --mode release --target-dir ./tmp/plugins
72+
- name: Cache wasm files (for pre-release)
73+
if: github.ref_type == 'tag'
74+
id: cache-wasm-files
75+
uses: actions/cache@v4
76+
with:
77+
path: ./tmp/plugins
78+
key: ${{ runner.os }}-wasm-files-${{ github.sha }}
79+
80+
pre-release:
81+
if: github.ref_type == 'tag'
82+
permissions:
83+
contents: write
84+
runs-on: ubuntu-latest
85+
needs: build-and-test
86+
steps:
87+
- name: Restore cached wasm files
88+
id: cache-wasm-files-restore
89+
uses: actions/cache/restore@v4
90+
with:
91+
path: ./tmp/plugins
92+
key: ${{ runner.os }}-wasm-files-${{ github.sha }}
93+
- name: Pre-release
94+
uses: softprops/action-gh-release@v2
95+
with:
96+
files: ./tmp/plugins/*.wasm

.github/workflows/web-host.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@ name: web-host
22
on: [push, pull_request]
33

44
jobs:
5+
# https://github.com/marketplace/actions/skip-duplicate-actions
6+
pre_job:
7+
# continue-on-error: true # Uncomment once integration is finished
8+
runs-on: ubuntu-latest
9+
# Map a step output to a job output
10+
outputs:
11+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
12+
steps:
13+
- id: skip_check
14+
uses: fkirc/skip-duplicate-actions@v5
15+
with:
16+
# All of these options are optional, so you can remove them if you are happy with the defaults
17+
# Skip a workflow run if the same workflow is already running
18+
concurrent_skipping: 'same_content_newer'
19+
skip_after_successful_duplicate: 'true'
20+
paths_ignore: '["**/README.md"]'
21+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
522
build:
23+
needs: pre_job
24+
if: needs.pre_job.outputs.should_skip != 'true'
625
runs-on: ubuntu-latest
726
steps:
827
- name: Set variables based on OS and architecture for just dl-wasi-sdk

justfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ build-release: build-repl-logic-guest-release build-plugins-release build-c-plug
6767
# Build all plugins in debug mode
6868
build-plugins:
6969
#!/usr/bin/env bash
70+
just build-repl-logic-guest
7071
just build-rust-plugins
7172
just build-c-plugins
7273

7374
# Build all plugins in release mode
7475
build-plugins-release:
7576
#!/usr/bin/env bash
77+
just build-repl-logic-guest-release
7678
just build-rust-plugins-release
7779
just build-c-plugins
7880

0 commit comments

Comments
 (0)