From dfbc989df4fd5b4bae58dc12024485ed3252916b Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 11 Sep 2024 15:55:39 -0700 Subject: [PATCH] add versioning --- .github/workflows/publish-to-dockerhub.yml | 23 ++++++++++++++++++++-- VERSION | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/.github/workflows/publish-to-dockerhub.yml b/.github/workflows/publish-to-dockerhub.yml index 459c660..4d873e2 100644 --- a/.github/workflows/publish-to-dockerhub.yml +++ b/.github/workflows/publish-to-dockerhub.yml @@ -1,4 +1,4 @@ -name: Publish Docker Image +name: Publish Docker Image and Create Release on: push: @@ -27,10 +27,29 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract version + id: vars + run: | + VERSION=$(cat VERSION) # Assumes you have a VERSION file in your repo + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Build and push Docker image uses: docker/build-push-action@v3 with: context: . push: true platforms: linux/amd64,linux/arm/v7,linux/arm64 - tags: thinkthinkai/think_db:latest + tags: thinkthinkai/think_db:latest,thinkthinkai/think_db:${{ env.VERSION }} + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + body: | + New release ${{ env.VERSION }} is out! + draft: false + prerelease: false diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..be0aef5 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0-alpha \ No newline at end of file