@@ -2,7 +2,26 @@ name: rust-host
22on : [push, pull_request]
33
44jobs :
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
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
0 commit comments