Skip to content

Commit

Permalink
Moved version to text file
Browse files Browse the repository at this point in the history
Updated action to not need python
  • Loading branch information
dbrewster committed Jul 10, 2024
1 parent 291020a commit 42bb3fe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/version_k8_op.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ jobs:
with:
go-version: '1.21.x'
cache-dependency-path: k8s-operator/go.sum
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -42,15 +36,29 @@ jobs:
with:
app_id: ${{ secrets.PUSH_APP_ID }}
private_key: ${{ secrets.PUSH_APP_PRIVATE_KEY }}
- name: version
- name: Get current version
id: get_version
run: echo "version=$(cat k8s-operator/VERSION)" >> $GITHUB_OUTPUT

- name: Increment version
uses: anothrNick/github-tag-action@1.35.0
id: increment_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
WITH_V: false
RELEASE_BRANCHES: main
CUSTOM_TAG: ${{ steps.get_version.outputs.version }}
- name: Update version in file
run: |
make -s -C scripts run "version_k8s"
echo K8_VERSION=$(node -p "require('./k8s-operator/env.json')['version']") >> $GITHUB_ENV
- name: Commit files
new_version=${{ steps.increment_version.outputs.new_tag }}
echo "$new_version" > k8s-operator/VERSION
- name: Commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "Add changes"
git add k8s-operator/VERSION
git commit -m "Bump version to ${{ steps.increment_version.outputs.new_tag }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
Expand Down
6 changes: 1 addition & 5 deletions k8s-operator/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
define GetFromPkg
$(shell node -p "require('./env.json').$(1)")
endef

# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= $(call GetFromPkg,version)
VERSION ?= $(shell cat VERSION)

DEFAULT_CHANNEL ?= alpha
CHANNELS ?= alpha
Expand Down
1 change: 1 addition & 0 deletions k8s-operator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.4
6 changes: 0 additions & 6 deletions k8s-operator/env.json

This file was deleted.

0 comments on commit 42bb3fe

Please sign in to comment.