Skip to content

chore: test release draft #17

chore: test release draft

chore: test release draft #17

name: CI Cortex JS
on:
push:
branches:
- chore/update-ci-for-cortex-artifact
workflow_dispatch:
jobs:
create-draft-release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.get_version.outputs.version }}
permissions:
contents: write
steps:
- name: Extract tag name without v prefix
id: get_version
run: |
echo "VERSION=0.4.17" >> $GITHUB_ENV
- name: Create Draft Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: v0.4.17
token: ${{ secrets.GITHUB_TOKEN }}
name: "${{ env.VERSION }}"
draft: true
prerelease: false
build-cortex-single-binary:
runs-on: ${{ matrix.runs-on }}
needs: [create-draft-release]
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "amd64"
runs-on: "ubuntu-20-04"
- os: "windows"
name: "amd64"
runs-on: "windows-cuda-12-0"
- os: "mac"
name: "amd64"
runs-on: "macos-13"
- os: "mac"
name: "arm64"
runs-on: "macos-latest"
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-dotnet@v3
if: runner.os == 'Windows'
with:
dotnet-version: "8.0.x"
- name: Install choco on Windows
if: runner.os == 'Windows'
run: |
choco install make -y
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm install -g yarn
- run: yarn install && yarn build && yarn build:binary
working-directory: ./cortex-js
- name: Get Cer for code signing
if: runner.os == 'macOS'
run: base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12
shell: bash
env:
CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
- uses: apple-actions/import-codesign-certs@v2
if: runner.os == 'macOS'
with:
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}
- name: Code Signing macOS
if: runner.os == 'macOS'
run: |
cd cortex-js
make codesign CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
- name: Post-Bundle
run: |
cd cortex-js
make postbundle
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: cortex-${{ matrix.os }}-${{ matrix.name }}
path: |
./cortex-js/cortex
./cortex-js/cortex.exe
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./cortex.tar.gz
asset_name: cortex-${{ needs.create-draft-release.outputs.version }}-${{ matrix.os }}.tar.gz
asset_content_type: application/gzip