From a28fa3792b9b4976f356ec2942c43afdfcd61a48 Mon Sep 17 00:00:00 2001 From: iddevops-bot Date: Fri, 23 Jun 2023 17:02:38 +0100 Subject: [PATCH] Removing auto-rebase action in favour of require updating of branch Signed-off-by: iddevops-bot --- .github/workflows/release.yml | 93 ++++++++++++++++++++++++----------- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ea80a5a8..d24ec7260 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,6 @@ jobs: path: ./deploy windows-package: - needs: [package] name: Create windows package runs-on: windows-latest steps: @@ -69,11 +68,40 @@ jobs: with: name: gauge-windows-artifact path: ./deploy + + gauge-version: + name: Upload gauge version + runs-on: ubuntu-latest + needs: [package, windows-package] + env: + GITHUB_TOKEN: '${{ secrets.GAUGEBOT_GITHUB_TOKEN }}' + steps: + - uses: actions/checkout@v2 + + - uses: actions/download-artifact@v1 + with: + name: gauge-non-windows-artifact + path: ./deploy + + - name: fetch gauge version + run: | + cd deploy + version=$(ls gauge-*-linux.x86.zip | sed 's/gauge-//' | sed 's/-linux.*//') + if [ -z "$version" ]; then + echo "Gauge version is not set" + exit 1 + fi + echo $version > ../version.txt + + - name: upload gauge version + uses: actions/upload-artifact@v1 + with: + name: gauge-version + path: ./version.txt github-release: - name: Publish github release runs-on: ubuntu-latest - needs: [windows-package] + needs: [gauge-version] env: GITHUB_TOKEN: '${{ secrets.GAUGEBOT_GITHUB_TOKEN }}' steps: @@ -88,41 +116,46 @@ jobs: with: name: gauge-windows-artifact path: ./deploy + + - name: Fetch gauge version + uses: actions/download-artifact@v1 + with: + name: gauge-version + path: . + + - name: Set gauge version + run: echo "GAUGE_VERSION=`cat version.txt`" >> $GITHUB_ENV - name: update release note run: | + echo "---------------------------" + echo "Creating release v$version" + echo "---------------------------" + cd deploy - version=$(ls gauge-*-linux.x86.zip | sed 's/gauge-//' | sed 's/-linux.*//') - if [ -z "$version" ]; then - echo "Gauge version is not set" - exit 1 - fi - echo -e "Gauge v$version\n\n" > desc.txt + echo -e "Gauge v$GAUGE_VERSION\n\n" > desc.txt release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" getgauge gauge) echo "$release_description" >> desc.txt - echo "Creating new draft for release v$version" - - hub release create -F ./desc.txt "v$version" - echo "Start uploading artifacts" - for artifact in `ls gauge-*`; do - hub release edit -m "" -a $artifact v$version - done - - cat desc.txt - + echo "Creating new draft for release v$GAUGE_VERSION" + hub release create -F ./desc.txt "v$GAUGE_VERSION" rm -rf desc.txt + sleep 10 - echo $version > ../version.txt + echo "---------------------------" + echo "Uploading artifacts" + echo "---------------------------" - - name: upload gauge version - uses: actions/upload-artifact@v1 - with: - name: gauge-version - path: ./version.txt + for artifact in `ls gauge-*`; do + echo $artifact + hub release edit -m "" -a $artifact v$GAUGE_VERSION + if [ $? -ne 0 ]; then + exit 1 + fi + done pypi-release: runs-on: ubuntu-latest - needs: [github-release] + needs: [gauge-version] steps: - uses: actions/checkout@v2 - run: git fetch --prune --unshallow @@ -155,8 +188,8 @@ jobs: python -m twine upload -u $PYPI_USER -p $PYPI_PASSWORD $gauge_package npm-release: - needs: [github-release] runs-on: ubuntu-latest + needs: [gauge-version] steps: - uses: actions/checkout@v2 - run: git fetch --prune --unshallow @@ -189,8 +222,8 @@ jobs: npm publish --access=public choco-release: - needs: [github-release] - runs-on: windows-latest + runs-on: ubuntu-latest + needs: [gauge-version] steps: - uses: actions/checkout@v2 - run: git fetch --prune --unshallow @@ -221,8 +254,8 @@ jobs: choco push "gauge.$Env:GAUGE_VERSION.nupkg" --apikey=$Env:API_KEY --source=https://push.chocolatey.org/ brew-release: - needs: [github-release] runs-on: ubuntu-latest + needs: [gauge-version] steps: - uses: actions/checkout@v2 - run: git fetch --prune --unshallow