Semantic versioning and release publishing #171
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build test | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: make gcc g++ libprotobuf-dev protobuf-compiler | |
version: 1.0 | |
- run: sudo apt install -y graphviz | |
- uses: lukka/get-cmake@latest | |
- run: protoc et_def.proto --proto_path et_def --cpp_out et_def | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- uses: s-weigand/setup-conda@v1 | |
with: | |
activate-conda: true | |
python-version: 3.7 | |
- run: conda install pytorch | |
- run: pip install fbgemm-gpu-cpu | |
- run: pip install . | |
- run: chakra_generator --num_npus 1 | |
- run: | | |
chakra_visualizer --help | |
for f in *.et | |
do | |
chakra_visualizer --input_filename ${f} --output_filename "${f%.*}".dot | |
done | |
- name: Set Up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Install protolock | |
run: | | |
go install github.com/nilslice/protolock/cmd/protolock@latest | |
protolock | |
- name: Check broken compatibility and update version | |
run: | | |
python3 version.py | |
echo "RELEASE_TAG=$(cat VERSION)" >> $GITHUB_ENV | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add VERSION | |
git add proto.lock | |
git commit -m "Updates VERSION" | |
git tag -d v$(RELEASE_TAG) || true | |
git tag -a v$(RELEASE_TAG) -m "Release ${RELEASE_TAG}" | |
git push -o ci.skip | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.RELEASE_TAG }} | |
release_name: Release ${{ env.RELEASE_TAG }} | |
body: | | |
Release ${{ env.RELEASE_TAG }} | |
draft: false | |
prerelease: false | |
- name: Build wheel | |
run: | | |
pip install --upgrade build | |
python3 -m build | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/chakra-${{ env.RELEASE_TAG }}-py3-none-any.whl | |
asset_name: chakra.whl | |
asset_content_type: application/whl |