Merge pull request #99 from Avivbens/better-ui-for-deps-and-paid #64
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: '📦 Create New Release' | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**/*' | |
branches: | |
- master | |
- beta | |
- +([0-9])?(.{+([0-9]),x}).x | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
deployments: write | |
concurrency: | |
group: release-ci-${{ github.repository }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
checks: | |
name: ✅ Check for Release | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
HUSKY: 0 | |
steps: | |
- name: 📀 Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 🧪 Check out repository code | |
uses: ./.github/workflows/health-check | |
release: | |
name: 📦 Release Version | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
needs: | |
- checks | |
env: | |
HUSKY: 0 | |
steps: | |
- name: 📀 Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: 🖥️ Setup Env | |
uses: ./.github/workflows/install | |
- name: 🆚 Extract Next Release Version | |
id: extract-version | |
run: | | |
npx semantic-release --no-ci --dry-run --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator > output.txt | |
NEXT_VERSION=$(cat output.txt \ | |
| grep "The next release version is" \ | |
| node -e "console.log(require('fs').readFileSync(0, 'utf-8').match(/The next release version is (\d+\.\d+\.\d+(-beta\.\d+)?)/)?.[1] ?? '')") | |
echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: 🔨 Build Package | |
if: steps.extract-version.outputs.version != '' | |
run: | | |
# update package.json version - for packing purposes | |
node -e "const fs = require('fs'); \ | |
const pkg = require('./package.json'); \ | |
pkg.version = '${{ steps.extract-version.outputs.version }}'; \ | |
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 4));" | |
npm run pack | |
- name: 🤐 Archive pack file | |
if: steps.extract-version.outputs.version != '' | |
uses: thedoctor0/zip-release@master | |
with: | |
path: ./bin/* | |
filename: pack.zip | |
- name: 🚀 Release | |
if: steps.extract-version.outputs.version != '' | |
env: | |
# This is required to make semantic-release work with GitHub Actions | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
GIT_AUTHOR_NAME: github-bot | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: github-bot | |
GIT_COMMITTER_EMAIL: [email protected] | |
run: | | |
npx semantic-release |