err #367
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 | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
update-version: | |
name: Update version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- run: npm run update-version | |
- name: Commit updated files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Update version" -a | |
- name: Push updated files | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
build: | |
needs: update-version | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
build-task: build-windows | |
- os: ubuntu-latest | |
build-task: build-linux | |
- os: macos-latest | |
build-task: build-mac | |
name: Build for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- name: Read package.json | |
uses: tyankatsu0105/read-package-version-actions@v1 | |
id: package-version | |
- name: Set environment vars for Windows | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
echo "ARTIFACT_FILE=./electron/dist/Yarn Classic Setup ${{ steps.package-version.outputs.version }}.exe" >> $env:GITHUB_ENV | |
echo "ARTIFACT_NAME=Yarn.Classic.Setup.${{ steps.package-version.outputs.version }}.exe" >> $env:GITHUB_ENV | |
- name: Set environment vars for Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo "ARTIFACT_FILE=./electron/dist/yarn-classic_${{ steps.package-version.outputs.version }}_amd64.snap" >> $GITHUB_ENV | |
echo "ARTIFACT_NAME=Yarn.Classic.Setup.${{ steps.package-version.outputs.version }}.snap" >> $GITHUB_ENV | |
- name: Set environment vars for Mac | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo "ARTIFACT_FILE=./electron/dist/Yarn Classic-${{ steps.package-version.outputs.version }}.dmg" >> $GITHUB_ENV | |
echo "ARTIFACT_NAME=Yarn.Classic.Setup.${{ steps.package-version.outputs.version }}.dmg" >> $GITHUB_ENV | |
- name: npm install and build | |
run: cd electron && yarn install && yarn run ${{ matrix.build-task }} | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACT_FILE }} | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} |