Skip to content

Commit e1da8a5

Browse files
authored
Make pre-release off main (#539)
1 parent 916328f commit e1da8a5

File tree

2 files changed

+50
-9
lines changed

2 files changed

+50
-9
lines changed

.github/workflows/integration-tests.yml .github/workflows/main.yml

+49-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: integration-tests
1+
name: main
22

33
on:
44
workflow_dispatch: # Allows running from actions tab
@@ -21,13 +21,13 @@ jobs:
2121
release_version: ${{ steps.versions.outputs.release_version }}
2222
is_prerelease_version: ${{ steps.versions.outputs.is_prerelease_version }}
2323
steps:
24-
- uses: actions/checkout@v3
25-
with:
26-
# We need to use a different github token because GITHUB_TOKEN cannot trigger a workflow from another
27-
token: ${{secrets.BASETENBOT_GITHUB_TOKEN}}
28-
fetch-depth: 2
29-
- uses: ./.github/actions/detect-versions/
30-
id: versions
24+
- uses: actions/checkout@v3
25+
with:
26+
# We need to use a different github token because GITHUB_TOKEN cannot trigger a workflow from another
27+
token: ${{secrets.BASETENBOT_GITHUB_TOKEN}}
28+
fetch-depth: 2
29+
- uses: ./.github/actions/detect-versions/
30+
id: versions
3131
build-and-push-truss-base-images-if-needed:
3232
needs: [detect-version-changed]
3333
if: needs.detect-version-changed.outputs.build_base_images == 'true'
@@ -72,3 +72,44 @@ jobs:
7272
- uses: ./.github/actions/setup-python/
7373
- run: poetry install
7474
- run: poetry run pytest truss/tests -m 'integration' --splits 5 --group ${{ matrix.split_group }}
75+
76+
publish-to-pypi:
77+
needs: [detect-version-changed]
78+
if: ${{ !failure() && !cancelled() && needs.detect-version-changed.outputs.release_version == 'true' && needs.detect-version-changed.outputs.is_prerelease_version == 'true' }}
79+
runs-on: ubuntu-20.04
80+
steps:
81+
- name: "Git tag release"
82+
uses: actions/checkout@v3
83+
with:
84+
token: ${{secrets.BASETENBOT_GITHUB_TOKEN}}
85+
- run: |
86+
NEW_VERSION=v${{ needs.detect-version-changed.outputs.new_version }}
87+
git config --global user.name "Github action"
88+
git config --global user.email "github.action@baseten.co"
89+
90+
git tag -a $NEW_VERSION -m "Release $NEW_VERSION"
91+
git push origin $NEW_VERSION
92+
93+
- uses: ./.github/actions/setup-python/
94+
95+
- name: Install poetry packages
96+
run: poetry install --no-dev
97+
98+
- name: Build
99+
run: poetry build
100+
101+
- name: Create Release
102+
uses: ncipollo/release-action@v1.12.0
103+
with:
104+
artifacts: "dist/*"
105+
token: ${{ secrets.BASETENBOT_GITHUB_TOKEN }}
106+
draft: false
107+
prerelease: ${{ needs.detect-version-changed.outputs.is_prerelease_version }}
108+
generateReleaseNotes: true
109+
makeLatest: true
110+
skipIfReleaseExists: true
111+
tag: "v${{ needs.detect-version-changed.outputs.new_version }}"
112+
113+
- name: Publish to PyPI
114+
if: ${{ github.event_name != 'pull_request' }}
115+
run: poetry publish -u "${{ secrets.PYPI_USERNAME }}" -p "${{ secrets.PYPI_PASSWORD }}"

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "truss"
3-
version = "0.5.7rc1"
3+
version = "0.5.7rc2"
44
description = "A seamless bridge from model development to model delivery"
55
license = "MIT"
66
readme = "README.md"

0 commit comments

Comments
 (0)