Skip to content

Release 0.0.55 by @cdhanna #75

Release 0.0.55 by @cdhanna

Release 0.0.55 by @cdhanna #75

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
commit:
type: string
description: Commit hash to deploy
default: main
majorSemver:
type: number
description: major number in semver
required: true
default: 0
minorSemver:
type: number
description: minor number in semver
required: true
default: 0
patchSemver:
type: number
description: patch number in semver
required: true
default: 0
publishVsCode:
type: boolean
description: publish the vs code extension?
required: true
default: true
publishNuget:
type: boolean
description: publish the nuget packages extension?
required: true
default: true
run-name: Release ${{ inputs.majorSemver }}.${{ inputs.minorSemver }}.${{ inputs.patchSemver }} by @${{ github.actor }}
jobs:
release:
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: release
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: pre-test setup
working-directory: ./FadeBasic
run: |
bash ./setup.sh
- name: pre-test check
working-directory: ./FadeBasic
run: |
dotnet nuget list source
- name: pre-test build
working-directory: ./FadeBasic
run: |
FADE_USE_LOCAL_SOURCE=true bash ./install.sh 0.0.1000 1 'LocalFade'
- name: run tests
working-directory: ./FadeBasic
run: |
dotnet nuget list source
FADE_NUGET_VERSION='0.0.1000.1' dotnet test Tests
- name: set FADE_NUGET_DRYRUN based on input
if: inputs.publishNuget == false
run: echo "FADE_NUGET_DRYRUN=true" >> $GITHUB_ENV
- name: Run Build Script
working-directory: ./FadeBasic
run: bash ./install.sh ${{ inputs.majorSemver }}.${{ inputs.minorSemver }}.${{ inputs.patchSemver }} 1 ${{ secrets.NUGET_HOST }} ${{ secrets.NUGET_API_KEY }}
# env:
# FADE_NUGET_DRYRUN: true
- name: Run VsCode Scripts
working-directory: ./VsCode/basicscript
if: inputs.publishVsCode == true
run: |
sudo chmod -R 777 out
npm install
npm version ${{ inputs.majorSemver }}.${{ inputs.minorSemver }}.${{ inputs.patchSemver }}
npx vsce publish -p ${{ secrets.VS_CODE_AZURE_PAT }}
- name: Create Git Tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag v${{ inputs.majorSemver }}.${{ inputs.minorSemver }}.${{ inputs.patchSemver }}
git push origin v${{ inputs.majorSemver }}.${{ inputs.minorSemver }}.${{ inputs.patchSemver }}
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ inputs.majorSemver }}.${{ inputs.minorSemver }}.${{ inputs.patchSemver }}"
NOTES=$(awk "/^\#\# \[$VERSION\]/{found=1; next} found && /^\#\# \[/{exit} found{print}" FadeBasic/CHANGELOG.md | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | sed '/./,$!d' | sed -e :a -e '/^\n*$/{$d;N;ba}')
gh release create "v$VERSION" \
--title "v$VERSION" \
--notes "$NOTES"