forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (118 loc) · 3.84 KB
/
release.yml
File metadata and controls
129 lines (118 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build Release
on:
# Manual Trigger GH CLI -> gh workflow run release.yml --ref <tag>
workflow_dispatch:
jobs:
run-python-tests:
uses: ./.github/workflows/python-tests.yml
with:
ref: ${{ github.ref_name }}
secrets:
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
permissions:
# Additional permissions for py-coverage-report
actions: read
pull-requests: write
run-javascript-tests:
uses: ./.github/workflows/js-tests.yml
with:
ref: ${{ github.ref_name }}
permissions:
# Additional permissions for coverage-comment
actions: read
pull-requests: write
run-playwright-tests:
uses: ./.github/workflows/playwright.yml
with:
ref: ${{ github.ref_name }}
build-release:
runs-on: ubuntu-latest
needs:
- run-python-tests
- run-javascript-tests
- run-playwright-tests
defaults:
run:
shell: bash
permissions:
# Additional permission needed to generate release
contents: write
id-token: write
env:
# Name of the tag
GIT_TAG: ${{ github.ref_name }}
# The owner and repository name
GH_REPO: ${{ github.repository }}
environment: release
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v5
with:
ref: ${{ github.ref_name }}
# Save the access token to the local git config, so
# later git commands can work.
persist-credentials: true
submodules: "recursive"
fetch-depth: 2
- name: Set Python version vars
uses: ./.github/actions/build_info
- name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
uses: actions/setup-python@v6
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- name: Look up the related GitHub PR branch name
# Need GH Token to use gh api
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install requests
echo "GH_PR_BRANCH=$(python scripts/get_release_branch.py)" >> $GITHUB_ENV
- name: Ensure release branch corresponding to this tag exists
env:
GH_PR_BRANCH: ${{ env.GH_PR_BRANCH }}
run: |
BRANCH_VERSION=$(echo "$GH_PR_BRANCH" | sed 's/release\///' )
if [ "$BRANCH_VERSION" != "$GIT_TAG" ]
then
echo "ERROR: release branch corresponding to this tag does not exist."
exit 1
fi
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Set release version from tag name
env:
GIT_TAG: ${{ env.GIT_TAG }}
run: echo "STREAMLIT_RELEASE_VERSION=$GIT_TAG" >> $GITHUB_ENV
- name: Create Package
timeout-minutes: 120
run: |
sudo apt install rsync
make package
- name: Store Package
uses: actions/upload-artifact@v5
with:
name: Release
path: lib/dist
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
packages-dir: lib/dist/
- name: Create GitHub Release
env:
GIT_TAG: ${{ env.GIT_TAG }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/create_release.py
- name: Successful Release Slack Message
if: ${{ success() }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
RUN_ID: ${{ github.run_id }}
run: python scripts/slack_notifications.py release success
- name: Failed Release Slack Message
if: ${{ failure() }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
RUN_ID: ${{ github.run_id }}
run: python scripts/slack_notifications.py release failure