-
Notifications
You must be signed in to change notification settings - Fork 108
78 lines (66 loc) · 2.07 KB
/
contracts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Contracts CI
on:
workflow_dispatch:
pull_request:
paths-ignore: frontend/**
push:
paths-ignore: frontend/**
branches: [master]
tags: ['v[0-9]+.[0-9]+.[0-9]+']
env:
CARGO_TERM_COLOR: always
defaults:
run:
working-directory: contracts
permissions:
contents: write
id-token: write
pages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
all:
name: All
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: ${{ github.ref_type == 'tag' && 'Build' || 'Build & CI' }}
run: '[ $GITHUB_REF_TYPE = "tag" ] && cargo b || cargo xtask ci'
- name: Update the nightly tag
if: github.ref == 'refs/heads/master'
run: |
git tag nightly
git push -f origin nightly
- name: Release
if: github.event_name != 'pull_request'
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref == 'refs/heads/master' && 'Nightly' || github.ref_name }}
tag_name: ${{ github.ref == 'refs/heads/master' && 'nightly' || github.ref_name }}
prerelease: ${{ github.ref == 'refs/heads/master' }}
files: |
contracts/target/wasm32-unknown-unknown/debug/*.*.wasm
contracts/target/wasm32-unknown-unknown/debug/*.meta.txt
- name: Upload the GitHub Pages artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: contracts/target/doc
# A separate job for the Pages deployment is neccessary to prevent the spam from the "deployed"
# messages in PRs.
# https://github.com/orgs/community/discussions/36919
deploy:
name: Deploy GitHub Pages
if: github.ref == 'refs/heads/master'
needs: all
environment: github-pages
runs-on: self-hosted
steps:
- name: Deploy GitHub Pages
uses: actions/deploy-pages@v4