|
| 1 | +name: Create release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + srtool: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v3 |
| 14 | + |
| 15 | + - name: Cache target dir |
| 16 | + uses: actions/cache@v3 |
| 17 | + with: |
| 18 | + path: '${{ github.workspace }}/substrate-node/runtime/target' |
| 19 | + key: srtool-target-tfchain-${{ github.sha }} |
| 20 | + restore-keys: | |
| 21 | + srtool-target-tfchain- |
| 22 | + srtool-target- |
| 23 | +
|
| 24 | + - name: Srtool build |
| 25 | + id: srtool_build |
| 26 | + |
| 27 | + with: |
| 28 | + workdir: '${{ github.workspace }}/substrate-node' |
| 29 | + package: tfchain-runtime |
| 30 | + runtime_dir: runtime |
| 31 | + |
| 32 | + - name: Summary |
| 33 | + run: | |
| 34 | + echo '${{ steps.srtool_build.outputs.json }}' | jq . > tfchain-srtool-digest.json |
| 35 | + cat tfchain-srtool-digest.json |
| 36 | + echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" |
| 37 | +
|
| 38 | + - name: Upload tfchain srtool json |
| 39 | + uses: actions/upload-artifact@v3 |
| 40 | + with: |
| 41 | + name: tfchain-srtool-digest-json |
| 42 | + path: tfchain-srtool-digest.json |
| 43 | + |
| 44 | + - name: Upload runtime |
| 45 | + uses: actions/upload-artifact@v3 |
| 46 | + with: |
| 47 | + name: tfchain-runtime |
| 48 | + path: substrate-node/${{ steps.srtool_build.outputs.wasm_compressed }} |
| 49 | + |
| 50 | + release: |
| 51 | + needs: srtool |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v3 |
| 56 | + with: |
| 57 | + fetch-depth: 0 # Work around for https://github.com/heinrichreimer/action-github-changelog-generator/issues/21 |
| 58 | + |
| 59 | + - name: Download artifacts |
| 60 | + id: download |
| 61 | + uses: actions/download-artifact@v3 |
| 62 | + with: |
| 63 | + name: tfchain-runtime |
| 64 | + path: tfchain-runtime |
| 65 | + |
| 66 | + - name: Generate changelog |
| 67 | + id: changelog |
| 68 | + uses: heinrichreimer/[email protected] |
| 69 | + with: |
| 70 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + headerLabel: "# 📑 Changelog" |
| 72 | + breakingLabel: '### 💥 Breaking' |
| 73 | + enhancementLabel: '### 🚀 Enhancements' |
| 74 | + bugsLabel: '### 🐛 Bug fixes' |
| 75 | + securityLabel: '### 🛡️ Security' |
| 76 | + issuesLabel: '### 📁 Other issues' |
| 77 | + prLabel: '### 📁 Other pull requests' |
| 78 | + addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}' |
| 79 | + onlyLastTag: true |
| 80 | + issues: false |
| 81 | + issuesWoLabels: false |
| 82 | + pullRequests: true |
| 83 | + prWoLabels: true |
| 84 | + author: true |
| 85 | + unreleased: true |
| 86 | + compareLink: true |
| 87 | + stripGeneratorNotice: true |
| 88 | + verbose: true |
| 89 | + |
| 90 | + - name: Create Release |
| 91 | + id: create_release |
| 92 | + uses: softprops/action-gh-release@v1 |
| 93 | + env: |
| 94 | + GITHUB_TOKEN: ${{ secrets.RELEASE_KEY }} |
| 95 | + with: |
| 96 | + tag_name: ${{ github.ref }} |
| 97 | + name: Release ${{ github.ref_name }} |
| 98 | + draft: false |
| 99 | + fail_on_unmatched_files: true |
| 100 | + prerelease: ${{ contains(github.ref, 'rc') }} |
| 101 | + body: ${{ steps.changelog.outputs.changelog }} |
| 102 | + files: tfchain-runtime/* |
0 commit comments