-
Notifications
You must be signed in to change notification settings - Fork 39
48 lines (47 loc) · 1.69 KB
/
contract-release.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
name: release_artifacts
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
defaults:
run:
working-directory: ./contracts
jobs:
get_projectserum_version:
name: Get ProjectSerum Version
runs-on: ubuntu-latest
outputs:
projectserum_version: ${{ steps.psversion.outputs.projectserum_version }}
steps:
- name: Checkout the repo
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Get ProjectSerum Version
id: psversion
uses: ./.github/actions/projectserum_version
release-artifacts:
name: Release Artifacts
runs-on: ubuntu-latest
needs: [get_projectserum_version]
# container:
# image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }}
# env:
# RUSTUP_HOME: "/root/.rustup"
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Build Artifacts
env:
psversion: ${{ needs.get_projectserum_version.outputs.projectserum_version }}
run: |
docker run -v "$(pwd)":/repo projectserum/build:"${psversion}" bash -c "\
anchor build &&\
chown -R $(id -u):$(id -g) /repo"
- name: Generate archive
run: |
tar cfvz artifacts.tar.gz target/deploy/*.so target/idl/*
- name: Create Release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
with:
files: |
contracts/artifacts.tar.gz
contracts/target/deploy/*.so