Bläddra i källkod

ci: tag after packaging but before publishing

Patrick Decat 9 månader sedan
förälder
incheckning
f99fc59460
1 ändrade filer med 14 tillägg och 8 borttagningar
  1. 14 8
      .github/workflows/marketplace-publish.yml

+ 14 - 8
.github/workflows/marketplace-publish.yml

@@ -25,24 +25,24 @@ jobs:
       - uses: actions/setup-node@v4
       - uses: actions/setup-node@v4
         with:
         with:
           node-version: 18
           node-version: 18
+
       - run: |
       - run: |
           git config user.name github-actions
           git config user.name github-actions
           git config user.email [email protected]
           git config user.email [email protected]
+
       - name: Install Dependencies
       - name: Install Dependencies
         run: |
         run: |
           npm install -g vsce ovsx
           npm install -g vsce ovsx
           npm run install:ci
           npm run install:ci
+
       - name: Create .env file
       - name: Create .env file
         run: |
         run: |
           echo "# PostHog API Keys for telemetry" > .env
           echo "# PostHog API Keys for telemetry" > .env
           echo "POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}" >> .env
           echo "POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}" >> .env
-      - name: Package and Publish Extension
-        env:
-          VSCE_PAT: ${{ secrets.VSCE_PAT }}
-          OVSX_PAT: ${{ secrets.OVSX_PAT }}
+
+      - name: Package Extension
         run: |
         run: |
           current_package_version=$(node -p "require('./package.json').version")
           current_package_version=$(node -p "require('./package.json').version")
-
           npm run vsix
           npm run vsix
           package=$(unzip -l bin/roo-cline-${current_package_version}.vsix)
           package=$(unzip -l bin/roo-cline-${current_package_version}.vsix)
           echo "$package"
           echo "$package"
@@ -51,12 +51,18 @@ jobs:
           echo "$package" | grep -q "extension/node_modules/@vscode/codicons/dist/codicon.ttf" || exit 1
           echo "$package" | grep -q "extension/node_modules/@vscode/codicons/dist/codicon.ttf" || exit 1
           echo "$package" | grep -q ".env" || exit 1
           echo "$package" | grep -q ".env" || exit 1
 
 
-          npm run publish:marketplace
-          echo "Successfully published version $current_package_version to VS Code Marketplace"
-      
       - name: Create and Push Git Tag
       - name: Create and Push Git Tag
         run: |
         run: |
           current_package_version=$(node -p "require('./package.json').version")
           current_package_version=$(node -p "require('./package.json').version")
           git tag -a "v${current_package_version}" -m "Release v${current_package_version}"
           git tag -a "v${current_package_version}" -m "Release v${current_package_version}"
           git push origin "v${current_package_version}"
           git push origin "v${current_package_version}"
           echo "Successfully created and pushed git tag v${current_package_version}"
           echo "Successfully created and pushed git tag v${current_package_version}"
+
+      - name: Publish Extension
+        env:
+          VSCE_PAT: ${{ secrets.VSCE_PAT }}
+          OVSX_PAT: ${{ secrets.OVSX_PAT }}
+        run: |
+          current_package_version=$(node -p "require('./package.json').version")
+          npm run publish:marketplace
+          echo "Successfully published version $current_package_version to VS Code Marketplace"