From 85063c2c6ebe22e1d5503f43b6f98a5b0ed04311 Mon Sep 17 00:00:00 2001 From: Ruan Comelli Date: Thu, 15 Jun 2023 10:25:55 -0300 Subject: [PATCH] ci: add action to publish pre-releases (#165) --- .github/workflows/prerelease.yml | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000..29fe6780 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,59 @@ +name: Pre-release VSIX + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + +jobs: + publish-vsix: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.SOURCERY_RELEASE_TOKEN }} + + - uses: actions/setup-node@v3 + with: + node-version: '14' + + - run: yarn install --frozen-lockfile + + - name: Update binaries + run: | + ./download-binaries.sh ${{ github.event.inputs.version }} + + - name: Update version number + run: yarn run bump ${{ github.event.inputs.version }} + + - name: Package VSCode extension + run: yarn run vsce package + + - name: Upload archive + uses: actions/upload-artifact@v3 + with: + path: sourcery-${{ github.event.inputs.version }}.vsix + + - name: Create release + uses: ncipollo/release-action@v1 + with: + tag: v${{ github.event.inputs.version }} + name: Sourcery ${{ github.event.inputs.version }} + body: v${{ github.event.inputs.version }} + prerelease: true + artifacts: sourcery-${{ github.event.inputs.version }}.vsix + artifactContentType: raw + artifactErrorsFailBuild: true + token: ${{ secrets.SOURCERY_RELEASE_TOKEN }} + + - name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + text: Publish VS Code extension pre-release v${{ github.event.inputs.version }} - ${{ job.status }} + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }} + if: always()