-
Notifications
You must be signed in to change notification settings - Fork 13
73 lines (70 loc) · 2.74 KB
/
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
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
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
container: cibuilds/github:0.13
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install libgcc
run: apk add libgcc
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Get version
id: get_version
run: |
VERSION=$(./devtools/get_version.sh)
echo ::set-output name=version::v$VERSION
- name: Get latest tag
id: get_latest_tag
uses: actions-ecosystem/action-get-latest-tag@v1
- name: Create new tag
if: ${{ steps.get_version.outputs.version != steps.get_latest_tag.outputs.tag }}
run: |
git tag ${{ steps.get_version.outputs.version }}
- name: Install Docker client
if: ${{ steps.get_version.outputs.version != steps.get_latest_tag.outputs.tag }}
run: |
apk add docker-cli
- name: Prepare volume with source code
if: ${{ steps.get_version.outputs.version != steps.get_latest_tag.outputs.tag }}
run: |
# create a dummy container which will hold a volume with config
docker create -v /code --name with_code alpine /bin/true
# copy a config file into this volume
docker cp ./Cargo.toml with_code:/code
docker cp ./Cargo.lock with_code:/code
docker cp ./contracts with_code:/code
docker cp ./packages with_code:/code
- name: Build development contracts
if: ${{ steps.get_version.outputs.version != steps.get_latest_tag.outputs.tag }}
run: |
echo "Building all contracts under ./contracts"
docker run --volumes-from with_code cosmwasm/rust-optimizer:0.12.9 ./contracts/*/
- name: Check development contracts
if: ${{ steps.get_version.outputs.version != steps.get_latest_tag.outputs.tag }}
working-directory: ./
run: |
echo "Checking all contracts under ./artifacts"
docker run --volumes-from with_code rust:1.60.0 /bin/bash -e -c 'cd ./code/packages/check; export GLOBIGNORE=../../artifacts/floaty.wasm; cargo run ../../artifacts/*.wasm'
docker cp with_code:/code/artifacts .
- name: Create Release
if: ${{ steps.get_version.outputs.version != steps.get_latest_tag.outputs.tag }}
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.version }}
body: ${{ github.event.pull_request.body }}
files: |
./artifacts/*
draft: false
prerelease: false