From 272167a3332f93ec426ad39de8c8748ea95abe29 Mon Sep 17 00:00:00 2001 From: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com> Date: Sun, 29 Jan 2023 13:41:58 -0800 Subject: [PATCH] Add auto-deployment (#328) --- .github/workflows/deploy.yml | 26 ++++++++++++++++++++++++ .github/workflows/project-management.yml | 2 ++ docs/Development.md | 17 ++++++++-------- 3 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..0e4713dd --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,26 @@ +# Whenever any tag is pushed to the repo +on: + push: + tags: + - '*' + +name: Deploy Extension +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.3.0 + - uses: actions/setup-node@v3.6.0 + - run: npm ci + - name: Publish to Open VSX Registry + uses: HaaLeo/publish-vscode-extension@v1 + with: + # Generated via https://open-vsx.org/user-settings/tokens, valid forever? + pat: ${{ secrets.OPEN_VSX_TOKEN }} + - name: Publish to Visual Studio Marketplace + uses: HaaLeo/publish-vscode-extension@v1 + with: + # https://dev.azure.com/markwiemer/_usersSettings/tokens, expires 2023-07-06 + # Saved locally as "CI VS Code Marketplace Publish Token" + pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} + registryUrl: https://marketplace.visualstudio.com diff --git a/.github/workflows/project-management.yml b/.github/workflows/project-management.yml index e64e8c63..1032577d 100644 --- a/.github/workflows/project-management.yml +++ b/.github/workflows/project-management.yml @@ -17,5 +17,7 @@ jobs: steps: - uses: actions/add-to-project@v0.3.0 with: + # https://github.com/settings/tokens + # https://github.com/vscode-autohotkey/ahkpp/settings/secrets/actions project-url: https://github.com/orgs/vscode-autohotkey/projects/1 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} diff --git a/docs/Development.md b/docs/Development.md index 72b5d218..6c74a58b 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -46,17 +46,18 @@ The tests should run automatically, and you should see passing output in the Deb ### Publishing 1. Tag the release - 1. `git checkout main` - 1. e.g. `git tag v2.8.2` - 1. `git push origin v2.8.2` - 1. [Create a new release for this tag](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/tags) + 1. `git checkout main && git tag v2.8.2 && git push origin v2.8.2` + 1. [Create a new GitHub release for this tag](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/tags) 1. Release title: Same as in [Changelog.md](../Changelog.md) 1. Description: Same as in changelog 1. Attach binary 1. Publish release -1. Publish the release through [Visual Studio Marketplace](https://marketplace.visualstudio.com/manage/publishers/mark-wiemer) - 1. Select the ellipsis `Actions` icon and select `Update`. - 1. Upload the `.vsix` release file packaged in a previous step. -1. Publish to Open VSX: `npx ovsx -p ` The release is usually available within 5 minutes of uploading. + +### Validating deployment + +1. [Deploy workflow](https://github.com/mark-wiemer/ahkpp/actions/workflows/deploy.yml) +1. [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=mark-wiemer.vscode-autohotkey-plus-plus) + 1. [Publisher view](https://marketplace.visualstudio.com/manage/publishers/mark-wiemer) +1. [Open VSX Marketplace](https://open-vsx.org/extension/mark-wiemer/vscode-autohotkey-plus-plus)