Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions .github/workflows/release-lit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ permissions:
contents: read

on:
workflow_dispatch:
inputs:
release-version:
description: 'Release Version'
required: true
type: string

push:
branches:
- main
paths:
- .github/workflows/release-lit.yml
- 'llvm/utils/lit/**'
pull_request:
paths:
- .github/workflows/release-lit.yml
- 'llvm/utils/lit/**'
workflow_call:
inputs:
release-version:
Expand All @@ -21,9 +24,21 @@ on:
RELEASE_TASKS_USER_TOKEN:
description: "Secret used to check user permissions."
required: false
workflow_dispatch:
inputs:
description_only:
description: Workflow dispatch only triggers a dry run, no upload to PyPI will occur.
type: string
default: 'Please read the description above.'
required: false
release-version:
description: 'Release Version'
required: true
type: string

jobs:
release-lit:
if: github.repository_owner == 'llvm' || github.event_name == 'workflow_dispatch'
name: Release Lit
runs-on: ubuntu-24.04
steps:
Expand All @@ -38,6 +53,7 @@ jobs:
sudo apt-get install -y python3-setuptools python3-psutil python3-github

- name: Check Permissions
if: contains(github.workflow_ref, '/.github/workflows/release-tasks.yml') && github.event_name != 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ github.token }}
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
Expand All @@ -47,7 +63,7 @@ jobs:
- name: Setup Cpp
uses: aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
with:
compiler: llvm-16.0.6
compiler: llvm-19.1.7
cmake: true
ninja: true

Expand All @@ -65,14 +81,22 @@ jobs:
sed -i 's/ + "dev"//g' lit/__init__.py
python3 setup.py sdist bdist_wheel

- name: Save lit package as an artifact
uses: actions/upload-artifact@v4
with:
name: lit-artifact
path: llvm/utils/lit/dist/

- name: Upload lit to test.pypi.org
if: contains(github.workflow_ref, '/.github/workflows/release-tasks.yml') && github.event_name != 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
password: ${{ secrets.LLVM_LIT_TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
packages-dir: llvm/utils/lit/dist/

- name: Upload lit to pypi.org
if: contains(github.workflow_ref, '/.github/workflows/release-tasks.yml') && github.event_name != 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
password: ${{ secrets.LLVM_LIT_PYPI_API_TOKEN }}
Expand Down