Release Latest #15
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
name: Release Latest | |
on: workflow_dispatch | |
jobs: | |
release_latest: | |
name: Release Latest | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
environment: | |
name: npm | |
url: https://www.npmjs.com/package/@hadronous/ic-angular | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup-pnpm | |
- uses: ./.github/actions/setup-commitizen | |
- name: Bump Version | |
run: cz bump --files-only --yes | |
- name: Build ic-build-angular | |
run: pnpm -F @hadronous/ic-build-angular build | |
- name: Build ic-angular | |
run: pnpm -F @hadronous/ic-angular build | |
- name: Get New Version | |
run: echo "version=$(cz version --project)" >> "$GITHUB_ENV" | |
- name: Push changes to repository | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'chore: release ${{ env.version }}' | |
commit_options: '--no-verify --signoff' | |
file_pattern: > | |
.cz.toml | |
CHANGELOG.md | |
packages/ic-angular/package.json | |
packages/ic-build-angular/package.json | |
tagging_message: '${{ env.version }}' | |
- name: Generate Release Notes | |
run: | | |
cz changelog --incremental --file-name RELEASE_NOTES.md | |
RELEASE_NOTES=$(cat RELEASE_NOTES.md) | |
echo "release_notes=$RELEASE_NOTES" >> "$GITHUB_ENV" | |
- name: Publish ic-angular to npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
run: | | |
npm pack ./packages/ic-angular/dist | |
npm publish --verbose --access public ./packages/ic-angular/dist | |
- name: Publish ic-build-angular to npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
run: | | |
npm pack ./packages/ic-build-angular/ | |
npm publish --verbose --access public ./packages/ic-build-angular/ | |
- name: Create Github release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: > | |
'hadronous-ic-angular-${{ env.version }}.tgz', | |
'hadronous-ic-build-angular-${{ env.version }}.tgz' | |
body: '${{ env.release_notes }}' | |
tag: '${{ env.version }}' | |
commit: 'main' | |
makeLatest: true | |
build_docs: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
needs: release_latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-pnpm | |
- name: Build Docs | |
run: pnpm -F docs build | |
- name: Fix permissions | |
run: | | |
chmod -c -R +rX "docs/build/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/build/ | |
deploy_docs: | |
name: Deploy Docs | |
runs-on: ubuntu-latest | |
needs: build_docs | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |