Skip to content

Commit

Permalink
use matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
eemmiillyy committed Apr 23, 2024
1 parent 91347b8 commit ac923bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-cli-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Release CLI
run: pnpm run release:cli
env:
RUNNER_OS: ${{ runner.os }}
MATRIX_OS: ${{ matrix.os }}
14 changes: 7 additions & 7 deletions scripts/release-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ const exec = util.promisify(execRaw);

const PATH_TO_CLI = process.cwd() + '/cli';

const runnerToOclif = (runner: string) => {
switch (runner) {
case 'Windows':
const matrixToOclif = (os: string) => {
switch (os) {
case 'windows-latest':
return 'win';
case 'macOS':
case 'macos-latest':
return 'macos';
case 'Linux':
case 'ubuntu-latest':
return 'deb';
default:
throw new Error('Unsupported OS');
}
};

async function main() {
if (!process.env.RUNNER_OS) throw new Error('RUNNER_OS is not set');
if (!process.env.MATRIX_OS) throw new Error('MATRIX_OS is not set');

const operatingSystem = runnerToOclif(process.env.RUNNER_OS);
const operatingSystem = matrixToOclif(process.env.MATRIX_OS);

const { manifest, fileName } = await readProjectManifest(PATH_TO_CLI);

Expand Down

0 comments on commit ac923bd

Please sign in to comment.