add draft as a release type
This commit is contained in:
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -3,6 +3,7 @@ name: Build & publish docs (rc + release)
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
|
- "draft*"
|
||||||
- "rc*"
|
- "rc*"
|
||||||
- "v*"
|
- "v*"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -100,7 +101,7 @@ jobs:
|
|||||||
zip -r "${GITHUB_REF_NAME}.zip" ./${GITHUB_REF_NAME}
|
zip -r "${GITHUB_REF_NAME}.zip" ./${GITHUB_REF_NAME}
|
||||||
|
|
||||||
- name: Publish prerelease
|
- name: Publish prerelease
|
||||||
if: startsWith(github.ref_name, 'rc')
|
if: startsWith(github.ref_name, 'rc') || startsWith(github.ref_name, 'draft')
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
@@ -143,7 +144,7 @@ jobs:
|
|||||||
if: startsWith(github.ref_name, 'rc')
|
if: startsWith(github.ref_name, 'rc')
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
rm -rf rc
|
rm -rf rc draft
|
||||||
mkdir -p rc
|
mkdir -p rc
|
||||||
cp -a ${RUNNER_TEMP}/mkdocs_out/site/. rc/
|
cp -a ${RUNNER_TEMP}/mkdocs_out/site/. rc/
|
||||||
printf '{"tag":"%s"}\n' "${GITHUB_REF_NAME}" > rc/rc.json
|
printf '{"tag":"%s"}\n' "${GITHUB_REF_NAME}" > rc/rc.json
|
||||||
@@ -152,4 +153,19 @@ jobs:
|
|||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git commit -m "Deploy RC preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
git commit -m "Deploy RC preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
|
git push origin gh-pages
|
||||||
|
|
||||||
|
- name: Deploy draft preview to /draft/
|
||||||
|
if: startsWith(github.ref_name, 'draft')
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
rm -rf rc draft
|
||||||
|
mkdir -p draft
|
||||||
|
cp -a ${RUNNER_TEMP}/mkdocs_out/site/. draft/
|
||||||
|
printf '{"tag":"%s"}\n' "${GITHUB_REF_NAME}" > draft/draft.json
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit -m "Deploy draft preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
git push origin gh-pages
|
git push origin gh-pages
|
||||||
Reference in New Issue
Block a user