Merge pull request #1141 from interlay/fix/txid-coinbase #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish draft release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" | |
- "[0-9]+.[0-9]+.[0-9]+*" | |
jobs: | |
build-runtimes: | |
runs-on: [self-hosted, linux] | |
strategy: | |
matrix: | |
runtime: ["interlay", "kintsugi"] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Build ${{ matrix.runtime }} runtime | |
id: srtool_build | |
uses: chevdor/[email protected] | |
with: | |
image: docker.io/interlayhq/srtool | |
tag: nightly-2022-12-15 | |
package: ${{ matrix.runtime }}-runtime-parachain | |
runtime_dir: ./parachain/runtime/${{ matrix.runtime }} | |
chain: ${{ matrix.runtime }} | |
- name: Store srtool digest to disk | |
run: | | |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}_srtool_output.json | |
- name: Upload ${{ matrix.runtime }} srtool json | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.runtime }}-srtool-json | |
path: ${{ matrix.runtime }}_srtool_output.json | |
- name: Upload ${{ matrix.runtime }} runtime | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.runtime }}-runtime | |
path: | | |
${{ steps.srtool_build.outputs.wasm_compressed }} | |
build-binary: | |
runs-on: [self-hosted, linux] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2022-06-20 | |
- run: | | |
find ./ -name Cargo.toml -exec ./scripts/update_cargo_version.sh {} \; | |
- name: build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --bin interbtc-parachain | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: interbtc | |
path: target/release/interbtc-parachain | |
build_docker: | |
runs-on: [self-hosted, linux] | |
needs: ["build-binary"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare | |
id: prep | |
run: | | |
TAG=$(echo $GITHUB_SHA | head -c7) | |
TS=$(date +%s) | |
echo ::set-output name=branch_name::$(echo ${GITHUB_REF##*/}) | |
echo ::set-output name=tag::${TAG} | |
echo ::set-output name=ts::${TS} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup docker context for buildx | |
id: buildx-context | |
run: | | |
docker context create builders | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
endpoint: builders | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Login to Dockerhub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: docker.io/interlayhq/interbtc | |
tags: | | |
type=sha,prefix=${{ steps.prep.outputs.branch_name }}-,suffix=-${{ steps.prep.outputs.ts }} | |
type=ref,event=branch | |
type=ref,event=tag | |
- uses: actions/download-artifact@v3 | |
with: | |
name: interbtc | |
path: target/release/ | |
- run: | | |
find ./target/ | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
file: ./Dockerfile_release | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64 | |
publish-draft-release: | |
runs-on: [self-hosted, linux] | |
needs: ["build-runtimes", "build-binary"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- run: | | |
find ./artifacts | |
bash scripts/release_notes.sh | |
rm -v ./artifacts/*/*.json | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: CHANGELOG.md | |
draft: true | |
files: | | |
artifacts/*/* |