From d79a9040ea52e9e0991cd665e27b52ba72b7da49 Mon Sep 17 00:00:00 2001 From: Matteo Morlacchi Date: Sat, 3 Aug 2024 23:30:04 +0200 Subject: [PATCH] ci: update ci.yml and release.yml --- .github/workflows/ci.yml | 9 +++-- .github/workflows/release.yml | 71 +++++++++++++++++------------------ 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05e9bab..0404e2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18.x - - run: npm install - - run: xvfb-run -a npm test + - name: Install deps + run: npm ci + - name: Run Tests + run: xvfb-run -a npm test if: runner.os == 'Linux' - - run: npm test + - name: Run Tests + run: npm test if: runner.os != 'Linux' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d193aa..243f03f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,42 +24,41 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18.x - - run: npm ci - - run: xvfb-run -a npm test + - name: Install deps + run: npm ci + - name: Run Tests + run: xvfb-run -a npm test if: runner.os == 'Linux' - - run: npm test + - name: Run Tests + run: npm test if: runner.os != 'Linux' - - run: | - git status -s + - name: Package if: success() && matrix.os == 'ubuntu-latest' - - # - name: Package - # if: success() && matrix.os == 'ubuntu-latest' - # run: | - # npm run package ${RELEASE_TYPE} - # echo "packageFile=$(ls *.vsix)" >> $GITHUB_ENV - # env: - # RELEASE_TYPE: ${{ inputs.releaseType }} - # - name: Publish - # if: success() && matrix.os == 'ubuntu-latest' - # run: | - # npm run publish -i ${VSIX_PATH} - # env: - # VSCE_PAT: ${{ secrets.VSCE_PAT }} - # VSIX_PATH: ${{ env.packageFile }} - # - name: Push tag - # if: success() && matrix.os == 'ubuntu-latest' - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # git config user.name "GitHub Actions" - # git config user.email "actions@github.com" - # git push --tags - # - name: Release - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # uses: softprops/action-gh-release@v2 - # if: success() && matrix.os == 'ubuntu-latest' - # with: - # files: | - # ${{ env.packageFile }} \ No newline at end of file + run: | + npm run package ${RELEASE_TYPE} + echo "packageFile=$(ls *.vsix)" >> $GITHUB_ENV + env: + RELEASE_TYPE: ${{ inputs.releaseType }} + - name: Publish + if: success() && matrix.os == 'ubuntu-latest' + run: | + npm run publish -i ${VSIX_PATH} + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} + VSIX_PATH: ${{ env.packageFile }} + - name: Push tag + if: success() && matrix.os == 'ubuntu-latest' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git push --tags + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 + if: success() && matrix.os == 'ubuntu-latest' + with: + files: | + ${{ env.packageFile }} \ No newline at end of file