Skip to content

Release flyteidl

Release flyteidl #26

name: Release flyteidl
on:
workflow_dispatch:
inputs:
version:
description: "version. Do *not* use the `flyteidl/` prefix, e.g. `flyteidl/v1.2.3`, instead use only `v1.2.3` (including the `v`)"
required: true
jobs:
push-flyteidl-tag:
name: Push git tag containing the `flyteidl/` prefix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.FLYTE_BOT_PAT }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/flyteidl/${{ github.event.inputs.version }}`,
sha: context.sha
})
deploy-to-pypi:
needs:
- push-flyteidl-tag
runs-on: ubuntu-latest
defaults:
run:
working-directory: flyteidl
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*
deploy-to-npm:
needs:
- push-flyteidl-tag
runs-on: ubuntu-latest
defaults:
run:
working-directory: flyteidl
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v1
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- name: Set version in npm package
run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
VERSION=$VERSION make update_npmversion
shell: bash
- run: |
npm install
- run: |
npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}