fix: last desperate attempt to restore automatic builds #745
This file contains hidden or 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: Release | |
on: | |
push: | |
branches: | |
- main | |
- pre/* | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install git | |
run: | | |
sudo apt update | |
sudo apt install -y git | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Clear Node.js cache | |
run: sudo apt-get purge -y nodejs | |
- name: Install Node Env | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Build app | |
run: | | |
uv sync --frozen | |
uv build | |
id: build_cache | |
if: success() | |
- name: Cache build | |
uses: actions/cache@v4 | |
with: | |
path: ./dist | |
key: ${{ runner.os }}-build-${{ hashFiles('dist/**') }} | |
if: steps.build_cache.outputs.id != '' | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: build | |
environment: development | |
if: | | |
github.event_name == 'push' && github.ref == 'refs/heads/main' || | |
github.event_name == 'push' && github.ref == 'refs/heads/pre/beta' || | |
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'main' || | |
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'pre/beta' | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Install semantic release plugins | |
run: npm install semantic-release-pypi@4 @semantic-release/git@10 @semantic-release/commit-analyzer@13 @semantic-release/release-notes-generator@14 @semantic-release/github@11 @semantic-release/changelog@6 conventional-changelog-conventionalcommits@8 --no-audit | |
- name: Clear npm cache | |
run: npm cache clean --force | |
- name: Clear Node.js cache | |
run: sudo apt-get purge -y nodejs | |
- name: Install Node Env | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4.1.0 | |
with: | |
semantic_version: 23 | |
extra_plugins: | | |
semantic-release-pypi@4 | |
@semantic-release/git@10 | |
@semantic-release/commit-analyzer@13 | |
@semantic-release/release-notes-generator@14 | |
@semantic-release/github@11 | |
@semantic-release/changelog@6 | |
conventional-changelog-conventionalcommits@8 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |