From 999d83fadab23cb63a4df95f0beb17734018c581 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Sun, 21 Jun 2020 12:07:19 -0400 Subject: [PATCH] Adds deploy github actions for prod builds --- .github/workflows/Deploy.yml | 3 +- .github/workflows/DeployExtensionsProd.yml | 43 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/DeployExtensionsProd.yml diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 03f95ad80..80a34f79f 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -29,6 +29,7 @@ jobs: # Setup the environment - run: 'json -I -f packages/svelte-vscode/package.json -e "this.version=\`99.0.0\`"' - run: 'json -I -f packages/svelte-vscode/package.json -e "this.preview=true"' + - run: 'json -I -f packages/svelte-vscode/package.json -e "this.name=\`svelte-vscode-nightly`"' # To deploy we need isolated node_modules folders which yarn won't do because it is a workspace # So, remove the workspace @@ -38,6 +39,6 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} VSCE_TOKEN: ${{ secrets.AZURE_PAN_TOKEN }} - with: + with: sort: '["svelte2tsx", "svelte-language-server", "svelte-check", "svelte-vscode"]' install: "true" diff --git a/.github/workflows/DeployExtensionsProd.yml b/.github/workflows/DeployExtensionsProd.yml new file mode 100644 index 000000000..6133df760 --- /dev/null +++ b/.github/workflows/DeployExtensionsProd.yml @@ -0,0 +1,43 @@ +name: Tagged Production Deploys + +on: + push: + tags: + - "*" + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: "12.x" + registry-url: "https://registry.npmjs.org" + + # Ensure everything is compiling + - run: "yarn install" + - run: "yarn build" + + # Lets us use one-liner JSON manipulations the package.json files + - run: "npm install -g json" + + # Setup the environment + - run: 'json -I -f packages/svelte-vscode/package.json -e "this.version=\`${{ github.ref }}\`"' + + # To deploy we need isolated node_modules folders which yarn won't do because it is a workspace + # So, remove the workspace + - run: "rm package.json yarn.lock" # Re-run the yarn install outside of the workspace + + - run: | + cd packages/svelte-vscode + yarn install + + # Just a hard constraint from the vscode marketplace's usage of azure tokens + echo "Once a year this expires, tell Orta to access https://dev.azure.com/ortatherox0608/_usersSettings/tokens to get a new one" + + # Ship it + npx vsce publish --yarn -p $VSCE_TOKEN + env: + VSCE_TOKEN: ${{ secrets.AZURE_PAN_TOKEN }}