forked from xqcxx/stellarguard
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.89 KB
/
Copy pathdeploy.yml
File metadata and controls
66 lines (54 loc) · 1.89 KB
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
name: Deploy Contracts
on:
push:
tags:
- 'v*.*.*'
env:
CARGO_TERM_COLOR: always
jobs:
deploy:
name: Deploy to Testnet
runs-on: ubuntu-latest
environment: testnet
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
smartcontract/target
key: ${{ runner.os }}-cargo-deploy-${{ hashFiles('smartcontract/**/Cargo.lock', 'smartcontract/**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-deploy-
- name: Install Stellar CLI
run: cargo install --locked stellar-cli
- name: Configure Stellar deployer identity
env:
STELLAR_SECRET_KEY: ${{ secrets.STELLAR_DEPLOY_SECRET_KEY }}
run: stellar keys add deployer --secret-key "$STELLAR_SECRET_KEY"
- name: Make deploy script executable
run: chmod +x scripts/deploy.sh
- name: Deploy contracts to testnet
run: ./scripts/deploy.sh --network testnet --source deployer
- name: Upload deployed-contracts.json as artifact
uses: actions/upload-artifact@v4
with:
name: deployed-contracts
path: scripts/deployed-contracts.json
- name: Commit updated deployed-contracts.json
env:
TAG_NAME: ${{ github.ref_name }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add scripts/deployed-contracts.json
git diff --staged --quiet || git commit -m "chore: update deployed-contracts.json for $TAG_NAME"
git push origin HEAD:main