Skip to content

Commit

Permalink
Rework release workflow (#361)
Browse files Browse the repository at this point in the history
* fix typo

* add release_type input choice

* adjust script accordingly

* add if check

* still need if statement

* fix args for script

* conditional build for docker

* add a generic task issue template

* update cargo

* bump runtime versions
  • Loading branch information
Kailai-Wang authored Feb 23, 2022
1 parent 2af6c7c commit 827f026
Show file tree
Hide file tree
Showing 7 changed files with 368 additions and 328 deletions.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Task issue template
about: Generic issue for new tasks
---

### Context

### Task

---
:heavy_check_mark: Please set appropriate **labels** and **assignees** if applicable.
27 changes: 22 additions & 5 deletions .github/workflows/create_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ on:
inputs:
chain:
type: choice
description: The chain whose runtime-wasm is released
description: Which parachain is regarded
options:
- litmus
- litentry
- litmus
- litentry
release_type:
type: choice
description: Which release type
options:
- client
- runtime
- both
release_tag:
description: an existing tag for creating release (e.g. v1.2.3)
required: true
Expand All @@ -23,13 +30,15 @@ on:

env:
CHAIN: ${{ github.event.inputs.chain }}
RELEASE_TYPE: ${{ github.event.inputs.release_type }}
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
DIFF_TAG: ${{ github.event.inputs.diff_tag }}
GENESIS_RELEASE: ${{ github.event.inputs.is_geneis_release }}

jobs:
## build runtime wasm ##
build-wasm:
if: github.event.inputs.release_type != 'client'
runs-on: ubuntu-latest
steps:
- name: Checkout codes on ${{ env.RELEASE_TAG }}
Expand Down Expand Up @@ -62,6 +71,7 @@ jobs:
## build docker image of client binary ##
build-docker:
if: github.event.inputs.release_type != 'runtime'
runs-on: self-hosted
steps:
- name: Checkout codes on ${{ env.RELEASE_TAG }}
Expand Down Expand Up @@ -107,7 +117,14 @@ jobs:
## create the release draft ##
create-release-draft:
runs-on: ubuntu-latest
needs: ["build-wasm", "build-docker"]
# see https://github.com/actions/runner/issues/491
# seems to be the only way to achieve this
needs:
- build-wasm
- build-docker
if: |
!failure() && !cancelled() &&
(success('build-wasm') || success('build-docker'))
steps:
- name: Checkout codes on ${{ env.RELEASE_TAG }}
uses: actions/checkout@v2
Expand All @@ -120,7 +137,7 @@ jobs:

- name: Generate release notes
run: |
./scripts/generate-release-notes.sh ${{ env.CHAIN }} ${{ github.workspace }}/.github/release_notes.md ${{ env.DIFF_TAG }}
./scripts/generate-release-notes.sh ${{ env.CHAIN }} ${{ github.workspace }}/.github/release_notes.md ${{ env.RELEASE_TYPE }} ${{ env.DIFF_TAG }}
- name: set CHAIN_TITLE env
run: echo "CHAIN_TITLE=${CHAIN/lit/Lit}" >> $GITHUB_ENV
Expand Down
Loading

0 comments on commit 827f026

Please sign in to comment.