name: Release on: push: tags: - 'v*' jobs: release: name: Release runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 with: # We have to checkout main or PNPM fails. Tag should be on main anyway. ref: main - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: 16 registry-url: 'https://registry.npmjs.org' - name: Install pnpm uses: pnpm/action-setup@v2 with: version: 7 - name: Get pnpm store directory id: pnpm-cache run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Setup pnpm cache uses: actions/cache@v3 with: path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install - uses: rhysd/changelog-from-release/action@v3 with: file: packages/iconoir-flutter/CHANGELOG.md github_token: ${{ secrets.GITHUB_TOKEN }} commit: false - name: Build run: pnpm run build - name: Prepare packages run: pnpm run prepublish-all env: TAG_NAME: ${{ github.ref_name }} - name: Commit release uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: Release Version ${{ github.ref_name }} branch: main - name: Update tag run: | git -c user.email="actions@github.com" -c user.name="GitHub Actions" tag -fa ${{ github.ref_name }} -m "${{ github.ref_name }}" git push -f origin ${{ github.ref_name }} - name: Publish packages run: pnpm -r publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} continue-on-error: true - name: Publish Flutter uses: sakebook/actions-flutter-pub-publisher@v1.4.1 with: credential: ${{ secrets.PUB_CREDENTIAL_JSON }} package_directory: ./packages/iconoir-flutter