2023-06-18 08:00:10 +00:00
|
|
|
# Actions to run after releasing a version, like:
|
|
|
|
# - Generating documentation via mkdocs
|
|
|
|
# - Notifying packaging repos
|
|
|
|
# - Automatically creating winget packages
|
2022-10-25 05:24:08 +00:00
|
|
|
|
2021-06-24 03:34:39 +00:00
|
|
|
name: post-release
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2023-06-25 21:35:39 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: "Which tag to deploy as:"
|
|
|
|
required: true
|
2021-06-24 03:34:39 +00:00
|
|
|
|
|
|
|
env:
|
2023-11-15 08:03:48 +00:00
|
|
|
# Assign commit authorship to official GitHub Actions bot when pushing to the `gh-pages` branch:
|
2021-09-20 05:09:10 +00:00
|
|
|
GIT_USER: "github-actions[bot]"
|
|
|
|
GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
|
2021-06-24 03:34:39 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-06-25 21:35:39 +00:00
|
|
|
initialize:
|
|
|
|
name: initialize
|
2021-06-24 03:34:39 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-25 21:35:39 +00:00
|
|
|
outputs:
|
|
|
|
version: ${{ env.VERSION }}
|
2021-06-24 03:34:39 +00:00
|
|
|
steps:
|
2023-06-25 21:35:39 +00:00
|
|
|
- name: Get the release version from the tag
|
|
|
|
if: env.VERSION == ''
|
2021-06-24 03:34:39 +00:00
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
|
|
|
|
echo "Manual run against a tag; overriding actual tag in the environment..."
|
|
|
|
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
|
|
|
fi
|
2021-06-24 03:34:39 +00:00
|
|
|
|
|
|
|
- name: Test env
|
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
echo ${{ env.VERSION }}
|
2021-06-24 03:34:39 +00:00
|
|
|
|
2023-06-25 21:35:39 +00:00
|
|
|
- name: Make sure you're not on master/main/nightly
|
2021-06-24 03:34:39 +00:00
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
if [[ ${{ env.VERSION }} == "master" || ${{ env.VERSION }} == "main" || ${{ env.VERSION }} == "nightly" ]]; then
|
2021-06-24 03:34:39 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-06-25 21:35:39 +00:00
|
|
|
docs:
|
|
|
|
needs: [initialize]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set release version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "RELEASE_VERSION=${{ needs.initialize.outputs.version }}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Validate release version
|
|
|
|
run: |
|
|
|
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
|
|
|
|
|
|
|
- name: Checkout repository
|
2023-11-19 00:15:28 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-25 21:35:39 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2024-01-28 11:11:42 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
|
2021-06-24 03:34:39 +00:00
|
|
|
with:
|
2023-02-03 08:25:25 +00:00
|
|
|
python-version: 3.11
|
2021-06-24 03:34:39 +00:00
|
|
|
|
2021-10-10 22:16:21 +00:00
|
|
|
- name: Install Python dependencies
|
2021-10-10 22:17:20 +00:00
|
|
|
run: pip install -r docs/requirements.txt
|
2021-06-24 03:34:39 +00:00
|
|
|
|
|
|
|
- name: Configure git user and email
|
|
|
|
run: |
|
|
|
|
git config --global user.name ${GIT_USER}
|
|
|
|
git config --global user.email ${GIT_EMAIL}
|
|
|
|
echo Name: $(git config --get user.name)
|
|
|
|
echo Email: $(git config --get user.email)
|
|
|
|
|
2022-01-02 01:45:44 +00:00
|
|
|
- name: Build and deploy docs with mike as the latest stable branch
|
2021-06-24 03:34:39 +00:00
|
|
|
run: |
|
|
|
|
cd docs
|
2022-01-02 01:45:44 +00:00
|
|
|
OLD_STABLE_VERSION=$(mike list stable | grep -Po '([0-9]+.[0-9]+.[0-9]+)' | head -n1)
|
|
|
|
echo ${OLD_STABLE_VERSION}
|
|
|
|
mike retitle --push stable ${OLD_STABLE_VERSION}
|
2021-06-24 03:34:39 +00:00
|
|
|
mike deploy --push --update-aliases ${RELEASE_VERSION} stable
|
2022-01-02 01:45:44 +00:00
|
|
|
mike retitle --push ${RELEASE_VERSION} "${RELEASE_VERSION} (stable)"
|
2021-06-24 03:34:39 +00:00
|
|
|
|
2023-06-18 08:00:10 +00:00
|
|
|
chocolatey:
|
2023-06-25 21:35:39 +00:00
|
|
|
needs: [initialize]
|
2021-06-24 03:34:39 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-25 21:35:39 +00:00
|
|
|
- name: Set release version
|
|
|
|
shell: bash
|
2021-06-24 03:34:39 +00:00
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
echo "RELEASE_VERSION=${{ needs.initialize.outputs.version }}" >> $GITHUB_ENV
|
2021-06-24 03:34:39 +00:00
|
|
|
|
2023-06-25 21:35:39 +00:00
|
|
|
- name: Validate release version
|
2021-06-24 03:34:39 +00:00
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
2021-06-24 03:34:39 +00:00
|
|
|
- name: Trigger choco
|
|
|
|
run: |
|
|
|
|
curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \
|
|
|
|
-H 'Accept: application/vnd.github.everest-preview+json' \
|
|
|
|
-u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
|
|
|
|
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
|
2023-06-18 08:00:10 +00:00
|
|
|
|
|
|
|
winget:
|
2023-06-25 21:35:39 +00:00
|
|
|
needs: [initialize]
|
2023-06-18 08:00:10 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2023-06-25 21:35:39 +00:00
|
|
|
- name: Set release version
|
|
|
|
shell: bash
|
2023-06-25 19:37:15 +00:00
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
echo "RELEASE_VERSION=${{ needs.initialize.outputs.version }}" >> $GITHUB_ENV
|
2023-06-25 19:37:15 +00:00
|
|
|
|
2023-06-25 21:35:39 +00:00
|
|
|
- name: Validate release version
|
2023-06-19 00:13:24 +00:00
|
|
|
run: |
|
2023-06-25 21:35:39 +00:00
|
|
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
2023-06-19 00:13:24 +00:00
|
|
|
|
2024-03-03 02:26:13 +00:00
|
|
|
- name: Automatically create PR for winget repos
|
2024-08-01 15:00:10 +00:00
|
|
|
uses: vedantmgoyal2009/winget-releaser@0db4f0a478166abd0fa438c631849f0b8dcfb99f
|
2023-06-18 08:00:10 +00:00
|
|
|
with:
|
2023-06-26 05:26:01 +00:00
|
|
|
identifier: Clement.bottom
|
2023-06-18 08:00:10 +00:00
|
|
|
installers-regex: '^bottom_x86_64_installer\.msi$'
|
2023-06-25 21:35:39 +00:00
|
|
|
version: ${{ env.RELEASE_VERSION }}
|
2023-06-26 05:26:01 +00:00
|
|
|
release-tag: ${{ env.RELEASE_VERSION }}
|
|
|
|
token: ${{ secrets.WINGET_TOKEN }}
|