Merge pull request #89 from iranpsc/feat/Skeleton #224
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: Auto release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "16.x" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Configure Git user | |
| run: | | |
| git config --global user.name "parsa" | |
| git config --global user.email "parsabr80@gmail.com" | |
| - name: Bump version using standard-version | |
| run: npx standard-version | |
| - name: Push changes | |
| run: git push --follow-tags origin main | |
| - name: Build the project | |
| run: npm run build | |
| - name: Zip dist folder | |
| run: | | |
| zip -r $GITHUB_WORKSPACE/output.zip dist/ | |
| echo "output.zip created" | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Generate tag name from package.json | |
| id: generate_tag | |
| run: | | |
| VERSION=$(jq -r ".version" package.json) | |
| echo "TAG_NAME=v$VERSION" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| release_name: "Release ${{ env.TAG_NAME }}" | |
| body: ${{ github.event.head_commit.message }} | |
| draft: false | |
| prerelease: false |