feat: added new packages core, openid4vc and didcomm (#75) #46
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 | |
| permissions: | |
| id-token: write | |
| pull-requests: write | |
| contents: write | |
| env: | |
| FORCE_COLOR: 3 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.22.1' | |
| cache: "pnpm" | |
| - name: Update npm | |
| run: npm install -g npm@^11 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| title: "chore(release): new version" | |
| commit: "chore(release): new version" | |
| publish: pnpm release | |
| version: pnpm changeset-version | |
| createGithubReleases: false | |
| - name: Get current package version | |
| id: get_version | |
| run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_ENV | |
| - name: Create Github Release | |
| if: "startsWith(github.event.head_commit.message, 'chore(release): new version')" | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.CURRENT_PACKAGE_VERSION }} | |
| release-unstable: | |
| name: Release Unstable | |
| runs-on: ubuntu-latest | |
| # We don't want to run release and release-unstable concurrently as NPM doesn't allow publishing packages while another version of the same package is | |
| # still processing. So we wait for release to finish, and the always() ensure that it will run no matter the result of release. | |
| needs: [release] | |
| if: "always() && github.event_name == 'push' && github.ref == 'refs/heads/alpha-release' && !startsWith(github.event.head_commit.message, 'chore(release): new version')" | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.22.1' | |
| cache: "pnpm" | |
| # Ensure npm 11.5.1 or later required by trusted publishing | |
| - name: Update npm | |
| run: npm install -g npm@^11 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Create unstable release | |
| env: | |
| TAG: ${{ github.event_name == 'push' && 'alpha' || format('pr-{0}', github.event.number) }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # this ensures there's always a patch release created | |
| cat << 'EOF' > .changeset/snapshot-template-changeset.md | |
| --- | |
| '@credebl/ssi-mobile-core': patch | |
| --- | |
| snapshot release | |
| EOF | |
| pnpm changeset version --snapshot ${{ env.TAG }} | |
| pnpm build | |
| pnpm changeset publish --tag ${{ env.TAG }} | |
| CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version") | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag v$CURRENT_PACKAGE_VERSION | |
| git push origin v$CURRENT_PACKAGE_VERSION --no-verify | |
| echo "Published version: $CURRENT_PACKAGE_VERSION with tag: alpha" |