Skip to content

chore: fix build yml #7

chore: fix build yml

chore: fix build yml #7

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
createrelease:
name: Create Release
permissions: write-all
runs-on: [ubuntu-latest]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
build:
permissions: write-all
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
TARGET: macos
PLATFORM: darwin
TYPE: x64
FORMAT: zip
ASSET_MIME: application/zip
- os: windows-latest
TARGET: windows
PLATFORM: squirrel.windows
TYPE: x64
FORMAT: exe
ASSET_MIME: application/vnd.microsoft.portable-executable
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install Dependencies
run: |
npm install yarn -g
yarn
- name: Build Release Files
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Show Build Output
run: ls -al out
# - name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# name: release_on_${{ matrix. os }}
# path: release/
# retention-days: 5
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Set env
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Upload Release Asset ${{ matrix.PLATFORM }}
if: runner.os != 'windows'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./out/make/zip/${{ matrix.PLATFORM }}/${{ matrix.TYPE }}/onepoint-${{ matrix.PLATFORM }}-${{ matrix.TYPE }}-${{ env.RELEASE_VERSION }}.zip
asset_name: onepoint-${{ matrix.PLATFORM }}-${{ matrix.TYPE }}-${{ env.RELEASE_VERSION }}.zip
asset_content_type: ${{ matrix.ASSET_MIME}}
# - name: Upload Release Asset win
# if: runner.os == 'windows'
# id: upload-release-asset-win
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release_info.outputs.upload_url }}
# asset_path: ./out/make/${{ matrix.PLATFORM }}/${{ matrix.TYPE }}/onepoint-${{ env.RELEASE_VERSION }} Setup.exe
# asset_name: onepoint-${{ env.RELEASE_VERSION }} Setup.exe
# asset_content_type: ${{ matrix.ASSET_MIME}}