Release v2.0.0 - Final Documentation Update #2
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Run build | |
| run: npm run build | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| # Get previous tag | |
| PREVIOUS_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null || echo "") | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| # First release - get all commits | |
| CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges) | |
| else | |
| # Get commits since previous tag | |
| CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges) | |
| fi | |
| # Save to output | |
| echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ steps.version.outputs.VERSION }} | |
| body: | | |
| ## Changes in this Release | |
| ${{ steps.changelog.outputs.CHANGELOG }} | |
| ## Installation | |
| ```bash | |
| npm install git+ssh://git@github.com:techdivision/appsheet.git#${{ github.ref_name }} | |
| ``` | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }} | |
| - name: Publish to npm | |
| if: "!contains(github.ref, '-')" | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| continue-on-error: true | |
| - name: Publish pre-release to npm | |
| if: contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') | |
| run: | | |
| if [[ "${{ github.ref }}" == *"-alpha"* ]]; then | |
| npm publish --access public --tag alpha | |
| elif [[ "${{ github.ref }}" == *"-beta"* ]]; then | |
| npm publish --access public --tag beta | |
| elif [[ "${{ github.ref }}" == *"-rc"* ]]; then | |
| npm publish --access public --tag rc | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| continue-on-error: true |