Skip to content

Commit

Permalink
Update test.yml
Browse files Browse the repository at this point in the history
Added --admin option
  • Loading branch information
lopezvoliver authored Nov 28, 2024
1 parent cac0edf commit 103eb87
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ jobs:

# Step 6: Set and get new version number
# (mocking the commits made by using vsce publish)
- name: mock vsce publish
id: publish
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
BRANCH_NAME="vsce-version-bump"
git checkout -b $BRANCH_NAME
#vsce publish ${{ github.event.inputs.release_type }} -p ${VSCE_PAT}
sed -i 's/0.2.1/0.3.0/g' package.json
sed -i 's/0.2.1/0.3.0/g' package-lock.json
NEW_VERSION=$(grep -m1 -Eo "([0-9]+\.[0-9]+\.[0-9]+)" package.json)
git add package.json package-lock.json
git commit -m "Bumped version to 0.3.0"
BRANCH_NAME=vsce-version-bump-${NEW_VERSION}
git branch -m $BRANCH_NAME
git push --set-upstream origin $BRANCH_NAME
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
#- name: mock vsce publish
# id: publish
# env:
# VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# BRANCH_NAME="vsce-version-bump"
# git checkout -b $BRANCH_NAME
# #vsce publish ${{ github.event.inputs.release_type }} -p ${VSCE_PAT}
# sed -i 's/0.2.1/0.3.0/g' package.json
# sed -i 's/0.2.1/0.3.0/g' package-lock.json
# NEW_VERSION=$(grep -m1 -Eo "([0-9]+\.[0-9]+\.[0-9]+)" package.json)
# git add package.json package-lock.json
# git commit -m "Bumped version to 0.3.0"
# BRANCH_NAME=vsce-version-bump-${NEW_VERSION}
# git branch -m $BRANCH_NAME
# git push --set-upstream origin $BRANCH_NAME
# echo "new_version=$NEW_VERSION" >> $GITHUB_ENV

# Step 7: Package the extension to a .vsix file
#- name: Package extension
Expand All @@ -78,14 +78,15 @@ jobs:
# name: eetasks-${new_version}
# path: "*.vsix"

# Step 9: Create pull request with the commit made by vsce
# Step 9: Create and merge pull request with the commit made by vsce
- name: Update repository
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="vsce-version-bump-${{ env.new_version }}"
gh pr create --title "Version bump to ${{ env.new_version}}" --body "Version bump to ${{ env.new_version }}" --base main --head $BRANCH_NAME
gh pr merge --merge --delete-branch --auto
BRANCH_NAME="vsce-version-bump-0.3.0" # change to ${{ env.new_version }} after test..
git checkout $BRANCH_NAME
#gh pr create --title "Version bump to ${{ env.new_version}}" --body "Version bump to ${{ env.new_version }}" --base main --head $BRANCH_NAME
gh pr merge --admin --merge --delete-branch --auto
# Step 10: Draft a GitHub release
- name: Draft GitHub Release
Expand Down

0 comments on commit 103eb87

Please sign in to comment.