Skip to content

Commit

Permalink
Some last improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Oct 17, 2023
1 parent a261959 commit 41611a1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/changelog-processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
if not line.startswith("## ["):
continue

version = line.strip().removeprefix("## [").removesuffix("]")
version = line.strip().removeprefix("## [").split("]")[0]
break

if args.print_latest_version:
Expand All @@ -43,6 +43,9 @@
if version.lower() == "unreleased":
print("0", end = "")
sys.exit(1)
elif version.count(".") != 2:
print("0", end = "")
sys.exit(-1)

stream = os.popen("git tag -l v" + version)
output = stream.read()
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Create Draft Release
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths: [ "CHANGELOG.md" ]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -81,7 +80,7 @@ jobs:
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}
publish-draft-release:
publish-release:
runs-on: ubuntu-latest
needs: [ build-runtimes, collect-release-information ]
outputs:
Expand All @@ -107,7 +106,6 @@ jobs:
SRTOOL() { <$(<<<$CONTEXT head -n1) jq -r .$1; }
WASM() { <${JSON} jq -r ".runtimes.compressed.subwasm.$1"; }
tee -a DRAFT <<-EOF
## Changelog
EOF
tee -a DRAFT <CHANGELOG.md
tee -a DRAFT <<-EOF
Expand All @@ -130,19 +128,19 @@ jobs:
EOF
done
- name: Create draft release
- name: Create release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ format('v{0}', needs.collect-release-information.outputs.version) }}
release_name: Runtimes ${{ github.sha }}
release_name: Runtimes ${{ needs.collect-release-information.outputs.version }}
body_path: DRAFT
draft: true
draft: false

publish-runtimes:
needs: [ runtime-matrix, publish-draft-release ]
needs: [ runtime-matrix, publish-release ]
continue-on-error: true
runs-on: ubuntu-latest
env:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Changelog for the runtimes governed by the Polkadot Fellowship.

## [1.0.0]
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Changed

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ To use it, write a comment in a PR that says:
This will enable [`auto-merge`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) in the Pull Request (or merge it if it is ready to merge).

The automation can be triggered by the author of the PR or any fellow whose GitHub handle is part of their identity.

# Release process

Releases are automatically pushed on commits merged to master that fulfill the following requirements:

- The [`CHANGELOG.md`](CHANGELOG.md) file was modified.
- The latest version (the version at the top of the file) in [`CHANGELOG.md`](CHANGELOG.md) has no tag in the repository.

The release process is building all runtimes and then puts them into a release in this github repository.

The format of [`CHANGELOG.md`](CHANGELOG.md) is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

0 comments on commit 41611a1

Please sign in to comment.