From 8453a61ff0bc69b9383024851b430ec7f483061b Mon Sep 17 00:00:00 2001 From: rithvikru Date: Tue, 6 Aug 2024 10:28:10 -0600 Subject: [PATCH] Fine perpleixty is ok --- .github/workflows/install.yml | 40 ++++++----------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 9fd3253..07226cb 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -2,8 +2,8 @@ name: Publish Install Script and Release on: push: - branches: - - main # or your default branch + tags: + - 'v*.*.*' jobs: publish: @@ -12,22 +12,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history for all tags and branches - - name: Get latest tag and increment version + - name: Get the version id: get_version - run: | - git fetch --tags - LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - LATEST_VERSION=${LATEST_TAG#v} - IFS='.' read -ra VERSION_PARTS <<< "$LATEST_VERSION" - MAJOR=${VERSION_PARTS[0]} - MINOR=${VERSION_PARTS[1]} - PATCH=$((VERSION_PARTS[2] + 1)) - NEW_VERSION="$MAJOR.$MINOR.$PATCH" - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - name: Make install.sh executable run: chmod +x install.sh @@ -44,8 +32,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.get_version.outputs.new_version }} - release_name: Release v${{ steps.get_version.outputs.new_version }} + tag_name: ${{ steps.get_version.outputs.VERSION }} + release_name: Release ${{ steps.get_version.outputs.VERSION }} draft: false prerelease: false @@ -58,19 +46,3 @@ jobs: asset_path: ./install.sh asset_name: install.sh asset_content_type: text/x-shellscript - - - name: Update version in Cargo.toml - run: | - sed -i 's/^version = ".*"/version = "${{ env.NEW_VERSION }}"/' Cargo.toml - - - name: Commit and push changes - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git add Cargo.toml - git commit -m "Bump version to ${{ env.NEW_VERSION }}" - git push - - - name: Push new tag - run: | - git push origin v${{ env.NEW_VERSION }}