From 59f95f4f7d7bd0fee059cdcf4547f620f011aafd Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 24 Mar 2024 18:18:20 +0200 Subject: [PATCH] remove files --- .github/scripts/create-release.sh | 41 --------------------------- .github/workflows/create_release.yaml | 33 --------------------- .github/workflows/release.yml | 7 +++-- 3 files changed, 4 insertions(+), 77 deletions(-) delete mode 100644 .github/scripts/create-release.sh delete mode 100644 .github/workflows/create_release.yaml diff --git a/.github/scripts/create-release.sh b/.github/scripts/create-release.sh deleted file mode 100644 index e7e135e899..0000000000 --- a/.github/scripts/create-release.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -ue - -SEMVER_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - -REL_VERSION=`echo $1 | sed -r 's/^[vV]?([0-9].+)$/\1/'` - -if [ `echo $REL_VERSION | pcre2grep "$SEMVER_REGEX"` ]; then - echo "$REL_VERSION is a valid semantic version." -else - echo "$REL_VERSION is not a valid semantic version." - exit 1 -fi - -MAJOR_MINOR_VERSION=`echo $REL_VERSION | cut -d. -f1,2` -RELEASE_BRANCH="release-$MAJOR_MINOR_VERSION" -RELEASE_TAG="v$REL_VERSION" - -if [ `git rev-parse --verify origin/$RELEASE_BRANCH 2>/dev/null` ]; then - echo "$RELEASE_BRANCH branch already exists, checking it out ..." - git checkout $RELEASE_BRANCH -else - echo "$RELEASE_BRANCH does not exist, creating ..." - git checkout -b $RELEASE_BRANCH - git push origin $RELEASE_BRANCH -fi -echo "$RELEASE_BRANCH branch is ready." - -if [ `git rev-parse --verify $RELEASE_TAG 2>/dev/null` ]; then - echo "$RELEASE_TAG tag already exists, aborting ..." - exit 2 -fi - -echo "Tagging $RELEASE_TAG ..." -git tag $RELEASE_TAG -echo "$RELEASE_TAG is tagged." - -echo "Pushing $RELEASE_TAG tag ..." -git push origin $RELEASE_TAG -echo "$RELEASE_TAG tag is pushed." \ No newline at end of file diff --git a/.github/workflows/create_release.yaml b/.github/workflows/create_release.yaml deleted file mode 100644 index 1524cb47d7..0000000000 --- a/.github/workflows/create_release.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Create a release - -on: - workflow_dispatch: - inputs: - rel_version: - description: 'Release version (examples: v1.3.0-rc.1, v1.3.0)' - required: true - type: string - -jobs: - create-release: - name: Creates release branch and tag - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install required packages - run: | - sudo apt-get update - sudo apt-get install pcre2-utils - - name: Create release branch and tag - env: - GITHUB_TOKEN: ${{ secrets.LAVANET_BOT_TOKEN }} - run: | - git config user.email "bot@lavanet.xyz" - git config user.name "LavaNet Bot" - # Update origin with token - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - chmod +x ./.github/scripts/create-release.sh - ./.github/scripts/create-release.sh ${{ inputs.rel_version }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f340f036c..577dc713d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,10 @@ name: Publish Lava Release on: push: tags: - - 'v*' + - 'v[0-9]+.[0-9]+.[0-9]+' permissions: - contents: write + contents: read jobs: release: @@ -16,7 +16,8 @@ jobs: binary: [lavad, lavap, lavavisor] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} - + permissions: + contents: write steps: - name: Checkout code uses: actions/checkout@v4