Skip to content

Commit ae2ca8c

Browse files
authored
Release v0.2.0 (#31)
* Release v0.2.0 * Add JetStream MaxText TPU inference user guide * update links in README * fix variable in README * Add MANIFEST.in for python pkg build * Update README - Apply suggestions from code review
1 parent 10bd138 commit ae2ca8c

File tree

6 files changed

+424
-3
lines changed

6 files changed

+424
-3
lines changed

.github/workflows/release.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# This workflow will create a release with git tag and publish a Python Package in PyPI.
17+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions; https://docs.pypi.org/trusted-publishers/adding-a-publisher/
18+
19+
name: Create Release
20+
21+
on:
22+
push:
23+
tags:
24+
- v*
25+
26+
# Needed to create release and upload assets
27+
permissions:
28+
contents: write
29+
30+
jobs:
31+
release:
32+
name: Create Release with tag
33+
runs-on: ${{ matrix.os }}
34+
needs: release
35+
strategy:
36+
matrix:
37+
os: [ubuntu-20.04]
38+
python-version: ['3.10']
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
- name: Extract release tag from branch
43+
shell: bash
44+
run: |
45+
echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
46+
- name: Create Github Release
47+
id: create_release
48+
uses: "actions/github-script@v6"
49+
env:
50+
RELEASE_TAG: ${{ env.release_tag }}
51+
with:
52+
github-token: "${{ secrets.GITHUB_TOKEN }}"
53+
script: |
54+
const script = require('.github/workflows/scripts/create_release.js')
55+
await script(github, context, core)
56+
57+
pypi:
58+
name: Build and Publish JetStream Python Package
59+
runs-on: ${{ matrix.os }}
60+
needs: release
61+
strategy:
62+
matrix:
63+
os: [ubuntu-20.04]
64+
python-version: ['3.10']
65+
environment:
66+
name: pypi
67+
url: https://pypi.org/project/google-jetstream
68+
permissions:
69+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
- name: Setup Python
74+
uses: actions/setup-python@v4
75+
with:
76+
python-version: ${{ matrix.python-version }}
77+
- name: Build Python distribution package
78+
run: |
79+
python -m pip install --upgrade build && python -m build
80+
- name: Publish Python package to PyPI
81+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Uses Github's API to create the release and wait for result.
18+
// We use a JS script since github CLI doesn't provide a way to wait for the release's creation and returns immediately.
19+
20+
module.exports = async (github, context, core) => {
21+
try {
22+
const response = await github.rest.repos.createRelease({
23+
draft: false,
24+
generate_release_notes: true,
25+
name: process.env.RELEASE_TAG,
26+
owner: context.repo.owner,
27+
prerelease: false,
28+
repo: context.repo.repo,
29+
tag_name: process.env.RELEASE_TAG,
30+
});
31+
32+
core.setOutput('upload_url', response.data.upload_url);
33+
} catch (error) {
34+
core.setFailed(error.message);
35+
}
36+
}

.github/workflows/UnitTests.yaml renamed to .github/workflows/unit_tests.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
python-version: ['3.10']
3636
runs-on: ${{ matrix.os }}
3737
steps:
38-
- uses: actions/checkout@v4
38+
- name: Checkout
39+
uses: actions/checkout@v4
3940
- name: Setup Python
4041
uses: actions/setup-python@v4
4142
with:
@@ -64,7 +65,8 @@ jobs:
6465
python-version: ['3.10']
6566
runs-on: ${{ matrix.os }}
6667
steps:
67-
- uses: actions/checkout@v4
68+
- name: Checkout
69+
uses: actions/checkout@v4
6870
- name: Setup Python
6971
uses: actions/setup-python@v4
7072
with:

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include requirements.in

0 commit comments

Comments
 (0)