-
Notifications
You must be signed in to change notification settings - Fork 74
83 lines (73 loc) · 2.74 KB
/
release.yml
File metadata and controls
83 lines (73 loc) · 2.74 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Publish draft release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
jobs:
deploy:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build Polkadot Archive
env:
SKIP_WASM_BUILD: 1
run: cargo build --release --manifest-path bin/polkadot-archive/Cargo.toml
- name: Prepare binary
run: |
mkdir -p release
strip bin/polkadot-archive/target/release/polkadot-archive
- name: Package for Debian
if: matrix.os == 'ubuntu-latest'
env:
SKIP_WASM_BUILD: 1
run: |
cargo install cargo-deb
cargo deb --manifest-path ./bin/polkadot-archive/Cargo.toml
mv ./bin/polkadot-archive/target/debian/*.deb ./release/polkadot-archive-linux.deb
tar -C ./bin/polkadot-archive/target/release/ -czvf ./release/polkadot-archive-linux.tar.gz ./polkadot-archive
- name: Package binary
if: matrix.os == 'ubuntu-latest'
run: |
mv bin/polkadot-archive/target/release/polkadot-archive ./release/polkadot-archive
- name: Get Archive changelog
id: changelog_reader
uses: mindsers/changelog-reader-action@5bfb30f7871d5c4cde50cd897314f37578043394 # v2.1.1
with:
validation_depth: 2
path: ./CHANGELOG.md
version: ${{ steps.tag_name.outputs.current_version }}
- name: Get Polkadot Archive changelog
id: changelog_reader_polkadot
uses: mindsers/changelog-reader-action@5bfb30f7871d5c4cde50cd897314f37578043394 # v2.1.1
with:
validation_depth: 2
path: ./bin/polkadot-archive/CHANGELOG.md
- name: Generate release notes
run: |
cat<<'EOF' > ${{ github.sha }}-BODY.txt
# Substrate Archive ${{ steps.changelog_reader.outputs.version }}
${{ steps.changelog_reader.outputs.changes }}
# Polkadot Archive ${{ steps.changelog_reader_polkadot.outputs.version }}
${{ steps.changelog_reader_polkadot.outputs.changes }}
EOF
- name: Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
with:
tag_name: ${{ steps.changelog_reader.outputs.version }}
name: Release ${{ steps.changelog_reader.outputs.version }}
body_path: ${{ github.sha }}-BODY.txt
draft: true
files: |
./release/*.tar.gz
./release/*.deb
./release/polkadot-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}