Skip to content

Package and release #20

Package and release

Package and release #20

name: Package and release
on:
workflow_dispatch:
schedule:
# Create rc every day at EOD of PST Mon-Fri + night of Sunday to kick off
# releases for beginning of work week
- cron: "0 1 * * 1,2,3,4,5,6"
permissions:
contents: write
packages: write
jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
build-artifact-profiler:
uses: ./.github/workflows/build-artifact.yaml
with:
tracy: true
single-card-demos:
needs: build-artifact
uses: ./.github/workflows/single-card-demo-tests-impl.yaml
secrets: inherit
t3000-demos:
needs: build-artifact
uses: ./.github/workflows/t3000-demo-tests-impl.yaml
secrets: inherit
t3000-model-perf:
needs: build-artifact
uses: ./.github/workflows/t3000-model-perf-tests-impl.yaml
secrets: inherit
tg-demos:
needs: build-artifact
uses: ./.github/workflows/tg-demo-tests-impl.yaml
secrets: inherit
tgg-model-perf:
needs: build-artifact
uses: ./.github/workflows/tgg-model-perf-tests-impl.yaml
secrets: inherit
get-params:
runs-on: ubuntu-latest
outputs:
is-release-candidate: ${{ steps.get-is-release-candidate.outputs.is-release-candidate }}
should-create-release: ${{ steps.get-should-create-release.outputs.should-create-release }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get is-release-candidate
id: get-is-release-candidate
run: |
# A workflow dispatch on a tag is considered a release run for us.
isReleaseCandidate=${{ !(github.ref_type == 'tag' && github.event_name == 'workflow_dispatch') }}
echo "is-release-candidate=$isReleaseCandidate" >> "$GITHUB_OUTPUT"
- name: Get should-create-release
id: get-should-create-release
run: |
# Run once to check for errors
./scripts/build_scripts/get_should_create_release.sh ${{ fromJSON(steps.get-is-release-candidate.outputs.is-release-candidate) && '--release-candidate' || '' }}
shouldCreateRelease=$(scripts/build_scripts/get_should_create_release.sh ${{ fromJSON(steps.get-is-release-candidate.outputs.is-release-candidate) && '--release-candidate' || '' }})
echo "should-create-release=$shouldCreateRelease" >> "$GITHUB_OUTPUT"
create-tag:
needs: get-params
if: ${{ fromJSON(needs.get-params.outputs.should-create-release) }}
uses: tenstorrent-metal/metal-workflows/.github/workflows/[email protected]
with:
fetch_depth: 0
bump_each_commit: false
release_candidate_suffix: ${{ needs.get-params.outputs.is-release-candidate && fromJSON(needs.get-params.outputs.is-release-candidate) }}
create-changelog:
needs: create-tag
permissions: read-all
runs-on: ubuntu-latest
steps:
- name: Create changelog
id: create-changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ignorePreReleases: true
failOnError: true
outputFile: CHANGELOG.txt
- name: Output changelog
run: cat CHANGELOG.txt
- name: Upload changelog as artifact
uses: actions/upload-artifact@v4
with:
name: changelog
path: CHANGELOG.txt
create-release-notes:
needs: create-changelog
permissions: read-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download changelog
uses: actions/download-artifact@v4
with:
name: changelog
- name: Create note about generating pipeline
shell: bash
run: echo "${{ format('This release was generated by the CI workflow https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}" > PIPELINE_NOTE.txt
- name: Create release notes by concatenating parts
shell: bash
run: |
touch RELEASE_NOTES.txt
cat infra/RELEASE_TOP_NOTE.txt >> RELEASE_NOTES.txt
echo "" >> RELEASE_NOTES.txt
cat PIPELINE_NOTE.txt >> RELEASE_NOTES.txt
echo "" >> RELEASE_NOTES.txt
cat CHANGELOG.txt >> RELEASE_NOTES.txt
- name: Output release notes
run: cat RELEASE_NOTES.txt
- uses: actions/upload-artifact@v4
with:
name: release-notes
path: RELEASE_NOTES.txt
# Candidate for breaking up
create-and-upload-draft-release:
needs: [
create-tag,
create-release-notes,
build-artifact,
]
strategy:
matrix:
os: [ubuntu-20.04]
# May accidentally create two releases without restricting to 1 job
concurrency: create_upload_draft_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Create archive with submodules
uses: qmonnet/git-archive-all-action@791fb850881cf58b1d1fcc9b06c01940080bba0a
with:
output-files: tt-metalium.tar.gz
- name: Download eager Python packages
uses: actions/download-artifact@v4
with:
name: eager-dist-${{ matrix.os }}-any
- name: Create VERSION
run: echo ${{ needs.create-tag.outputs.version }} > VERSION
- name : Download release notes
uses: actions/download-artifact@v4
with:
name: release-notes
- name : Download changelog
uses: actions/download-artifact@v4
with:
name: changelog
- name: Assert wheels exist
run: ls -arhl ttnn-*+*.whl
- name: Release
# A major release has not been tagged yet, so we need to do this to avoid
# Node 16 deprecation warning message
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
tag_name: ${{ needs.create-tag.outputs.version }}
name: ${{ needs.create-tag.outputs.version }}
draft: false
prerelease: true
body_path: RELEASE_NOTES.txt
files: |
VERSION
CHANGELOG.txt
README.md
INSTALLING.md
models/MODEL_UPDATES.md
ttnn-*+*.whl
tt-metalium.tar.gz
fail_on_unmatched_files: true
create-docker-release-image:
needs: [
build-artifact,
create-tag,
create-and-upload-draft-release
]
uses: ./.github/workflows/publish-release-image.yaml
secrets: inherit
with:
base-image: ${{ needs.build-artifact.outputs.ci-build-docker-image }}
version: ${{ needs.create-tag.outputs.version }}
is_major_version: ${{ needs.get-params.outputs.is-release-candidate !='true' && needs.get-params.outputs.should-create-release == 'true' }}
release-docs:
needs: [
get-params,
create-tag,
create-and-upload-draft-release
]
if: ${{ needs.get-params.outputs.is-release-candidate !='true' && needs.get-params.outputs.should-create-release == 'true' }}
uses: ./.github/workflows/docs-release.yaml
with:
version: ${{ needs.create-tag.outputs.version }}
secrets: inherit