5.1.0-1 #164
Workflow file for this run
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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | |
name: cmf-cli | |
on: | |
# workflow_dispatch: | |
# inputs: | |
# tag: | |
# description: 'Main tag to publish' | |
release: | |
types: [published] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/[email protected] | |
with: | |
dotnet-version: '8.0.x' | |
- name: install zip | |
uses: montudor/[email protected] | |
- run: npm install | |
- run: npm run build:prod | |
- name: create artifact win-x64 | |
run: zip -X -r ../cmf-cli.win-x64.zip . | |
working-directory: dist/win-x64 | |
- name: Create artifact linux-x64 | |
run: zip -X -r ../cmf-cli.linux-x64.zip . | |
working-directory: dist/linux-x64 | |
- name: Create artifact osx-x64 | |
run: zip -X -r ../cmf-cli.osx-x64.zip . | |
working-directory: dist/osx-x64 | |
- name: Publish win-x64 to release | |
uses: JasonEtco/upload-to-release@master | |
with: | |
args: dist/cmf-cli.win-x64.zip application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish linux-x64 to release | |
uses: JasonEtco/upload-to-release@master | |
with: | |
args: dist/cmf-cli.linux-x64.zip application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish osx-x64 to release | |
uses: JasonEtco/upload-to-release@master | |
with: | |
args: dist/cmf-cli.osx-x64.zip application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm run publish | |
if: "github.event.release.prerelease" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm run publish:live | |
if: "!github.event.release.prerelease" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Re-version Core Nuget for pre-release | |
if: "github.event.release.prerelease" | |
run: sed -i.orig -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)/\1\.\2\.\3-pre.\4/' core.csproj | |
working-directory: ./core | |
- name: Publish Core NuGet | |
id: publish_nuget | |
uses: alirezanet/[email protected] | |
with: | |
PROJECT_FILE_PATH: core/core.csproj | |
TAG_COMMIT: false | |
NUGET_KEY: ${{secrets.NUGET_API_KEY}} |