Browse Source

Simplify dev release

(cherry picked from commit 1f1824cfe6b89e2acab187eff1fab466284f4faf)
dinhlongnguyen 1 year ago
parent
commit
057696cc33
2 changed files with 6 additions and 37 deletions
  1. 0 36
      .github/workflows/publish-dev.yml
  2. 6 1
      .github/workflows/release-dev.yml

+ 0 - 36
.github/workflows/publish-dev.yml

@@ -21,42 +21,6 @@ jobs:
         id: vars
         run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
 
-      - name: Extract branch name
-        shell: bash
-        run: |
-          git fetch origin
-          git branch -r --contains ${{ github.ref }}
-          raw=$(git branch -r --contains ${{ github.ref }})
-          branch=$(echo ${raw##*/} | tr [:upper:] [:lower:])
-          echo "branch=$branch" >> $GITHUB_OUTPUT
-          echo "Branch is $branch."
-        id: extract_branch
-
-      - name: Checkout latest from branch
-        uses: actions/checkout@v2
-        with:
-          repository: Avaiga/taipy
-          ref: ${{ steps.extract_branch.outputs.branch }}
-          path: './latest'
-
-      - name: Validate Github Tag Version
-        run: |
-          echo """
-          import json, sys, os
-          SUFFIX = 'dev'
-          if SUFFIX not in sys.argv[1]:
-              raise ValueError(f'Tag {sys.argv[1]} does not contain suffix {SUFFIX}')
-          with open(f\"latest{os.sep}src{os.sep}taipy{os.sep}version.json\") as version_file:
-              version_o = json.load(version_file)
-          version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
-          if vext := version_o.get(\"ext\"):
-              vext = 'dev' + str(int(vext.replace('dev', '')) - 1)
-              version = f'{version}.{vext}'
-          if version != sys.argv[1]:
-              raise ValueError(f'Tag {sys.argv[1]} is not the latest dev version of branch {sys.argv[2]}')
-          """ > /tmp/check.py
-          python /tmp/check.py "${{ steps.vars.outputs.tag }}" "${{ steps.extract_branch.outputs.branch }}"
-
       - name: Ensure package version has 'dev' suffix
         run: |
           echo """

+ 6 - 1
.github/workflows/release-dev.yml

@@ -130,10 +130,15 @@ jobs:
           python -c "import taipy as tp; tp.gui"
           python -c "import taipy as tp; tp.rest"
 
+      - name: Extract commit hash
+        shell: bash
+        run: echo "HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
+        id: extract_hash
+
       - name: Create/update release and tag
         run: |
             echo "Creating release ${{ steps.current-version.outputs.VERSION }}"
-            gh release create ${{ steps.current-version.outputs.VERSION }} ./dist/taipy-${{ steps.current-version.outputs.VERSION }}.tar.gz --prerelease --title ${{ steps.current-version.outputs.VERSION }} --notes "Release Draft ${{ steps.current-version.outputs.VERSION }}"
+            gh release create ${{ steps.current-version.outputs.VERSION }} ./dist/taipy-${{ steps.current-version.outputs.VERSION }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.current-version.outputs.VERSION }} --notes "Release Draft ${{ steps.current-version.outputs.VERSION }}"
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}