update workflow #462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "*" | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| PROJECT: vscode-lua | |
| BIN_DIR: server/bin | |
| PKG_SUFFIX: vsix | |
| jobs: | |
| compile: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: ubuntu-22.04, target: linux, platform: linux-x64 } | |
| - { os: ubuntu-24.04-arm, target: linux, platform: linux-arm64 } | |
| - { os: macos-latest, target: darwin, platform: darwin-x64 } | |
| - { os: macos-latest, target: darwin, platform: darwin-arm64 } | |
| - { os: windows-latest, target: windows, platform: win32-x64 } | |
| #- { os: windows-latest, target: windows, platform: win32-ia32 } # 不再支持32位 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actboy168/setup-luamake@master | |
| - name: Build | |
| run: luamake -platform ${{ matrix.platform }} | |
| - name: Setting up workflow variables | |
| id: vars | |
| shell: bash | |
| run: | | |
| # Package version | |
| if [[ $GITHUB_REF = refs/tags/* ]]; then | |
| PKG_VERSION=${GITHUB_REF##*/} | |
| else | |
| PKG_VERSION=${GITHUB_SHA:0:7} | |
| fi | |
| # Package name w/ version | |
| PKG_BASENAME="${{ env.PROJECT }}-${PKG_VERSION}-${{ matrix.platform }}" | |
| # Full name of the tarball asset | |
| PKG_NAME="${PKG_BASENAME}.${PKG_SUFFIX}" | |
| echo PKG_BASENAME=${PKG_BASENAME} >> $GITHUB_OUTPUT | |
| echo PKG_NAME=${PKG_NAME} >> $GITHUB_OUTPUT | |
| - name: Compile client | |
| shell: bash | |
| run: | | |
| npm install -g typescript | |
| cd client | |
| npm ci | |
| npm run build | |
| cd .. | |
| - name: Build Addon Manager WebVue | |
| shell: bash | |
| run: | | |
| cd client/webvue | |
| npm ci | |
| npm run build | |
| cd ../.. | |
| - name: Pack vsix | |
| id: pack | |
| shell: bash | |
| run: | | |
| npm install -g @vscode/vsce | |
| vsce package -o ${{ steps.vars.outputs.PKG_NAME }} -t ${{ matrix.platform }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.vars.outputs.PKG_BASENAME }} | |
| path: ${{ steps.vars.outputs.PKG_NAME }} | |
| - name: Publish release assets | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| ${{ steps.vars.outputs.PKG_NAME }} | |
| - name: Publish to VSCode Market | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: vsce publish -i ${{ steps.vars.outputs.PKG_NAME }} -p ${{ secrets.VSCE_TOKEN }} | |
| - name: Publish to Open VSX Registry | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| npm install -g ovsx | |
| ovsx publish -i ${{ steps.vars.outputs.PKG_NAME }} -p ${{ secrets.OVSX_TOKEN }} |