machine-setup: fix #30
This file contains 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 and release | |
on: | |
push: | |
branches: | |
- main | |
env: | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: yarn | |
- name: Build | |
run: yarn build | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: yarn | |
- name: Build | |
run: yarn build:pkg | |
- name: Copy Origin Bundle to Dist | |
run: cp dist/xcpc-tools.js /tmp/xcpc-tools-bundle.js | |
- name: Create Zip for Windows | |
run: zip -r /tmp/xcpc-tools-win.zip dist/pkg/xcpc-tools-win.exe | |
- name: Create Tar for MacOS | |
run: tar -czvf /tmp/xcpc-tools-macos.tar.gz dist/pkg/xcpc-tools-macos | |
- name: Create Tar for Linux | |
run: tar -czvf /tmp/xcpc-tools-linux.tar.gz dist/pkg/xcpc-tools-linux | |
- name: Build Machine Setup package | |
run: | | |
cd packages/machine-setup | |
yarn neu update | |
yarn neu build --clean | |
- name: Create Tar for Machine Setup | |
run: tar -czvf /tmp/xcpc-tools-machine-setup.tar.gz packages/machine-setup/dist/hydro-xcpctools-machine-setup | |
- name: Get release version and commit | |
id: tag | |
run: | | |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
echo "version=$(node -p "require('./packages/server/package.json').version")" >> $GITHUB_OUTPUT | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.tag.outputs.version }}-${{ steps.tag.outputs.sha_short }} | |
files: | | |
/tmp/xcpc-tools-bundle.js | |
/tmp/xcpc-tools-win.zip | |
/tmp/xcpc-tools-macos.tar.gz | |
/tmp/xcpc-tools-linux.tar.gz | |
/tmp/xcpc-tools-machine-setup-app.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |