basant307/AI_Governance_Project
048
1name: Feature Release2 3on:4 workflow_dispatch:5 inputs:6 branch:7 description: 'Branch to run the action on'8 required: true9 default: 'unstable'10 11jobs: 12 feature-release:13 runs-on: ubuntu-latest14 environment: prod15 timeout-minutes: 1016 17 steps:18 - name: checkout unstable branch19 uses: actions/checkout@v620 with:21 ref: 'unstable'22 fetch-depth: 023 - uses: actions/setup-node@v624 with:25 node-version-file: .nvmrc26 cache: 'npm'27 - name: Install dependencies28 run: npm install29 - name: Install Playwright Browsers30 run: npx playwright install --with-deps31 - name: Run tests32 run : |33 npm test34 - name: Determine version for the release35 id: get_new_patch_version36 run: |37 pwd38 chmod 777 -R ./* ./.[!.]*39 . ./.github/workflows/scripts/new-feature-version.sh40 shell: bash41 - name: See new master version and jq version42 run: |43 echo VERSION ${{ env.VERSION }}44 jq --version45 shell: bash46 - name: Checkout Master Branch47 uses: actions/checkout@v648 with:49 ref: master50 fetch-depth: 051 - name: Update documentation and Merge unstable to master branch52 run: |53 . ./.github/workflows/scripts/merge_unstable_to_master.sh54 - name: Build release and verify changes55 id: release56 run: |57 . .github/workflows/scripts/pre_release_test.sh master58 - name: Archive code coverage results59 uses: actions/upload-artifact@v460 if: ${{ failure() && steps.release.conclusion == 'failure' }}61 with:62 name: npm-release--failure-report63 path: /home/runner/.npm/_logs/64 - name: Publish Package to GitHub Releases65 run: |66 curl -L \67 -X POST \68 -H "Accept: application/vnd.github+json" \69 -H "Authorization: Bearer ${{ secrets.MAIN_GH_TOKEN }}" \70 -H "X-GitHub-Api-Version: 2022-11-28" \71 https://api.github.com/repos/${{ github.repository }}/releases \72 -d '{"tag_name":"v${{ env.VERSION }}","target_commitish":"master","name":"v${{ env.VERSION }}","body":"Release version v${{ env.VERSION }}","draft":false,"prerelease":false,"generate_release_notes":false}'73 - name: Deploy to Github Pages ๐74 uses: JamesIves/github-pages-deploy-action@v475 with:76 folder: documentation 77 - name: Create Issue78 run: |79 TITLE="Create a blog post for release v$VERSION"80 echo "Issue title: $TITLE"81 sed ':a;N;$!ba;s/\n/\\n/g' ./.github/workflows/md/blog-issue-template.md > output_file.txt82 BODY="$(cat output_file.txt)"83 84 echo "Body: $BODY"85 86 curl -X POST \87 -H "Authorization: token ${{ secrets.CYTOSCAPE_JS_BLOG_TOKEN }}" \88 -H "Accept: application/vnd.github.v3+json" \89 "https://api.github.com/repos/cytoscape/cytoscape.js-blog/issues" \90 -d "{\"title\":\"$TITLE\",\"body\":\"$BODY\"}"91 92 npm_publish:93 needs: feature-release94 permissions:95 contents: read96 id-token: write97 uses: ./.github/workflows/npm-publish.yml98 99 