|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + release: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: Clone Repository |
| 12 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0 |
| 13 | + with: |
| 14 | + fetch-depth: 0 |
| 15 | + fetch-tags: true |
| 16 | + - name: Setup Node version |
| 17 | + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # tag v6.0.0 |
| 18 | + with: |
| 19 | + node-version: 22 |
| 20 | + - name: Install dependencies |
| 21 | + run: npm install |
| 22 | + - name: Set package.json version |
| 23 | + run: npm version ${{github.ref_name}} --no-git-tag-version |
| 24 | + - name: Install VSCE |
| 25 | + run: npm install -g @vscode/vsce |
| 26 | + - name: Create Changelog |
| 27 | + run: | |
| 28 | + git log $(git describe --tags --abbrev=0)..HEAD --oneline &> ${{ github.workspace }}-CHANGELOG.txt |
| 29 | + cat ${{ github.workspace }}-CHANGELOG.txt |
| 30 | + - name: Compile New Version |
| 31 | + run: | |
| 32 | + RELEASE_VERSION=$(npx semver ${{github.ref_name}} -i $RELEASE_TYPE) |
| 33 | + echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV |
| 34 | + echo "Bump to $RELEASE_VERSION" |
| 35 | + - name: Package Extension |
| 36 | + run: vsce package $RELEASE_VERSION --no-git-tag-version --no-update-package-json -o "./releases/github-workflow-updater-$RELEASE_VERSION.vsix" |
| 37 | + # - name: Publish to Visual Studio Marketplace |
| 38 | + # run: vsce publish --packagePath "./releases/github-workflow-updater-$RELEASE_VERSION.vsix" --no-git-tag-version --no-update-package-json -p ${{ secrets.VSC_MKTP_PAT }} |
| 39 | + - name: Publish to Open VSX Registry |
| 40 | + continue-on-error: true |
| 41 | + uses: HaaLeo/publish-vscode-extension@ca5561daa085dee804bf9f37fe0165785a9b14db # tag v2.0.0 |
| 42 | + with: |
| 43 | + preRelease: false |
| 44 | + pat: ${{ secrets.OPEN_VSX_TOKEN }} |
| 45 | + extensionFile: ./releases/codacy-${{ env.RELEASE_VERSION }}.vsix |
0 commit comments