2020-01-17 17:40:06 +01:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2020-03-07 11:33:15 +01:00
|
|
|
- 'v*.*.*'
|
2020-01-17 17:40:06 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
2022-03-02 03:40:05 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-01-17 17:40:06 +01:00
|
|
|
|
|
|
|
- name: Dump GitHub context
|
|
|
|
env:
|
|
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
|
|
run: echo "${GITHUB_CONTEXT}"
|
|
|
|
|
2020-01-26 12:31:36 +01:00
|
|
|
- name: Install github/hub
|
2020-01-17 17:40:06 +01:00
|
|
|
run: |
|
2020-03-07 11:33:15 +01:00
|
|
|
export HUB_VERSION="2.14.2"
|
2020-03-09 12:23:44 +01:00
|
|
|
curl -fsSL https://github.com/github/hub/raw/8d91904208171b013f9a9d1175f4ab39068db047/script/get | bash -s "${HUB_VERSION}"
|
2020-01-17 17:40:06 +01:00
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
TAG_NAME="${GITHUB_REF##refs/tags/}"
|
|
|
|
echo "See [CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG_NAME}/CHANGELOG.md) for more details." > ./release_notes.md
|
2020-01-26 12:31:36 +01:00
|
|
|
RELEASE_NAME="$(jq -r '.name' ./package.json)"
|
|
|
|
sed -i "1i${RELEASE_NAME} ${TAG_NAME}\n" ./release_notes.md
|
|
|
|
./bin/hub release create \
|
2020-01-17 17:40:06 +01:00
|
|
|
--draft \
|
|
|
|
--prerelease \
|
|
|
|
--file ./release_notes.md \
|
|
|
|
"${TAG_NAME}"
|