Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate release process #69

Merged
merged 7 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 6 additions & 32 deletions .github/workflows/build-vsix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
branches: main
inputs:
tag:
description: 'Release Tag. This is in the form xx.yy.zz'
description: 'Release Tag. This is in the form x.y.z'
required: true
jobs:
build-vsix:
runs-on: ubuntu-latest
env:
CI_COMMIT_AUTHOR: CentML
CI_COMMIT_EMAIL: centml-machine-user@users.noreply.github.com
steps:
- name: Fetch repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:
- name: Commit updated version number and tag it
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "username@users.noreply.github.com"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git commit -am "Release version ${{ github.event.inputs.tag }}"
git push origin release/${{ github.event.inputs.tag }}
git tag ${{ github.event.inputs.tag }}
Expand All @@ -50,38 +51,10 @@ jobs:
run: |
scripts/build_vsix.sh

- name: Upload vsix artifact
uses: actions/upload-artifact@v3
with:
name: deepview-explore-${{ github.event.inputs.tag }}.vsix
path: deepview-explore/deepview-explore-${{ github.event.inputs.tag }}.vsix

- name: Publish to VSCode Marketplace
run: |
vsce package -p {{ secrets.AZURE_PAT }} -i deepview-explore-${{ github.event.inputs.tag}}.vsix


publish-release:
name: Publish Release
needs: build-vsix
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set RELEASE_VERSION
run: |
RELEASE_VERSION=$(node -p "require('./deepview-explore/package.json').version")
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: deepview-explore-${{ github.event.inputs.tag }}.vsix
path: dist

vsce publish -p ${{ secrets.AZURE_PAT }} -i deepview-explore/deepview-explore-${{ github.event.inputs.tag}}.vsix

- name: Publish a release
run: |
RELEASE_NOTES="$(git log $(git describe --abbrev=0 --tags --always).. --merges --pretty=format:"%s %b" | cut -f 4,7- -d ' ')"
Expand All @@ -95,3 +68,4 @@ jobs:
--notes "$RELEASE_NOTES" \
--target "$GITHUB_SHA" \
$RELEASE_ARTIFACTS
gh pr create --title "Release $VERSION_TAG" --body "$RELEASE_NOTES"
15 changes: 15 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# How to release a new version of DeepView.Explore
- Go to Github repo and run the action `build-vsix`. You will be prompted to specify the version number.

- This runs a GitHub Action that will take the following steps:
1. Fetches the repo and its dependencies
2. Creates a release branch
3. Updates the version number to the user-specified version by updating the package.json
4. Commits the changes and tag the commit with the version number
5. Builds the VSIX
6. Publishes the VSIX to VSCode Marketplace
7. Publishes a release to Github
8. Create a PR to merge back into main
- The action `build-vsix` is defined under `.github/workflows/build-vsix.yaml`

- This release process follows the release process outlined in [OneFlow](https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow).