diff --git a/flyteidl/.github/workflows/master.yml b/flyteidl/.github/workflows/master.yml new file mode 100644 index 0000000000..7ad6553229 --- /dev/null +++ b/flyteidl/.github/workflows/master.yml @@ -0,0 +1,45 @@ +name: Master + +on: + push: + branches: + - master + +jobs: + bump-version: + name: Bump Version + runs-on: ubuntu-latest + needs: build-docker # Only to ensure it can successfully build + outputs: + version: ${{ steps.bump-version.outputs.tag }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Bump version and push tag + id: bump-version + uses: anothrNick/github-tag-action@1.17.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + DEFAULT_BUMP: patch + + goreleaser: + name: Goreleaser + runs-on: ubuntu-latest + needs: [bump-version] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} \ No newline at end of file diff --git a/flyteidl/.github/workflows/npmpublish.yaml b/flyteidl/.github/workflows/npmpublish.yaml index d0e5ea386e..1101ca0a20 100644 --- a/flyteidl/.github/workflows/npmpublish.yaml +++ b/flyteidl/.github/workflows/npmpublish.yaml @@ -14,6 +14,12 @@ jobs: with: node-version: "12.x" registry-url: "https://registry.npmjs.org" + - name: Autobump version + 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: diff --git a/flyteidl/.github/workflows/pythonpublish.yaml b/flyteidl/.github/workflows/pythonpublish.yaml index bd89bd3ed3..b418b35c1b 100644 --- a/flyteidl/.github/workflows/pythonpublish.yaml +++ b/flyteidl/.github/workflows/pythonpublish.yaml @@ -17,6 +17,12 @@ jobs: run: | python -m pip install --upgrade pip pip install setuptools wheel twine + - name: Autobump version + run: | + # from refs/tags/v1.2.3 get 1.2.3 + VERSION=$(echo $GITHUB_REF | sed 's#.*/v##') + VERSION=$VERSION make update_pyversion + shell: bash - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/flyteidl/.goreleaser.yml b/flyteidl/.goreleaser.yml new file mode 100644 index 0000000000..615bea6ba7 --- /dev/null +++ b/flyteidl/.goreleaser.yml @@ -0,0 +1,9 @@ +project_name: flyteidl +builds: + - skip: true +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' \ No newline at end of file diff --git a/flyteidl/Makefile b/flyteidl/Makefile index f9cfdc06a3..794dea48c1 100644 --- a/flyteidl/Makefile +++ b/flyteidl/Makefile @@ -1,4 +1,5 @@ #!/bin/bash + export REPOSITORY=flyteidl include boilerplate/lyft/golang_test_targets/Makefile @@ -40,3 +41,17 @@ install-piptools: .PHONY: doc-requirements.txt doc-requirements.txt: doc-requirements.in install-piptools $(call PIP_COMPILE,doc-requirements.in) + +PLACEHOLDER := "__version__\ =\ \"develop\"" +PLACEHOLDER_NPM := \"version\": \"develop\" +VERSION := "v1.0.0" + +.PHONY: update_pyversion +update_pyversion: + grep "$(PLACEHOLDER)" "setup.py" + sed -i "s/$(PLACEHOLDER)/__version__ = \"${VERSION}\"/g" "setup.py" + +.PHONY: update_npmversion +update_npmversion: + grep "$(PLACEHOLDER_NPM)" "package.json" + sed -i "s/$(PLACEHOLDER_NPM)/\"version\": \"${VERSION}\"/g" "package.json" \ No newline at end of file diff --git a/flyteidl/package.json b/flyteidl/package.json index b9ecd74306..9667801568 100644 --- a/flyteidl/package.json +++ b/flyteidl/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/flyteidl", - "version": "0.18.18", + "version": "develop", "description": "Compiled protocol buffers and gRPC service clients/servers for Flyte IDLs", "repository": { "type": "git", diff --git a/flyteidl/setup.py b/flyteidl/setup.py index 83cf67e168..cd6987c76c 100644 --- a/flyteidl/setup.py +++ b/flyteidl/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -__version__ = '0.18.18' +__version__ = "develop" setup( name='flyteidl',