Prerelease 1.7.1-a1 #381
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish release | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
release: | |
name: Release | |
if: github.event.pull_request.merged && (startsWith(github.head_ref, 'release/') || startsWith(github.head_ref, 'prerelease/')) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_ACCESS_TOKEN_TOM }} | |
- id: get-release-type | |
run: | | |
echo "type=$(${{ startsWith(github.head_ref, 'prerelease/') }} && echo 'prerelease' || echo 'release')" >> "$GITHUB_OUTPUT" | |
echo "prefix=$(${{ startsWith(github.head_ref, 'prerelease/') }} && echo 'Prerelease' || echo 'Release')" >> "$GITHUB_OUTPUT" | |
- id: get-version | |
run: | | |
if [ ${{ steps.get-release-type.outputs.type }} = 'prerelease' ]; then | |
echo "version=$(echo ${{ github.head_ref }} | sed 's|prerelease/||')" >> "$GITHUB_OUTPUT" | |
else | |
echo "version=$(echo ${{ github.head_ref }} | sed 's|release/||')" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Use Node 22 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: 'latest' | |
- name: Install just | |
uses: extractions/setup-just@v2 | |
- name: Install JS dependencies | |
run: npm ci | |
- name: Update docs requirements | |
run: just _set-docs-version ${{ steps.get-version.outputs.version }} | |
if: ${{ steps.get-release-type.outputs.type == 'release' }} | |
- name: Build dash-bootstrap-components | |
run: just build | |
- uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
- name: Publish to PyPI | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: py-dist/ | |
- name: Commit updated package-lock.json and docs requirements | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: ${{ steps.get-release-type.outputs.prefix }} ${{ steps.get-version.outputs.version }} | |
branch: main | |
push_options: --force | |
file_pattern: package-lock.json docs/requirements.txt | |
- name: Create GitHub release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get-version.outputs.version }} | |
release_name: ${{ steps.get-release-type.outputs.prefix }} ${{ steps.get-version.outputs.version }} | |
body: ${{ github.event.pull_request.body }} | |
prerelease: ${{ steps.get-release-type.outputs.type == 'prerelease' }} | |
- name: Post-release cleanup | |
run: just postrelease ${{ steps.get-version.outputs.version }} | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Back to dev | |
branch: main | |
push_options: --force | |
file_pattern: package.json tests/test_version.py dash_bootstrap_components/_version.py uv.lock |