diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..be2682a4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +--- +name: Release sdk + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + release: + env: + ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} + ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.ATALA_GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + + - uses: crazy-max/ghaction-import-gpg@v5 + id: import_gpg + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + git_user_signingkey: true + git_commit_gpgsign: true + + - name: Release + env: + GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }} + GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }} + GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }} + GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }} + run: | + npm install + npx semantic-release diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e69de29b diff --git a/package.json b/package.json new file mode 100644 index 00000000..5dfe7afe --- /dev/null +++ b/package.json @@ -0,0 +1,75 @@ +{ + "name": "atala-prism-wallet-sdk-swift", + "version": "2.0.1", + "description": "atala-prism-wallet-sdk-swift", + "directories": { + "example": "examples" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/input-output-hk/atala-prism-wallet-sdk-swift.git" + }, + "author": "IOG", + "license": "ISC", + "bugs": { + "url": "https://github.com/input-output-hk/atala-prism-wallet-sdk-swift/issues" + }, + "homepage": "https://github.com/input-output-hk/atala-prism-wallet-sdk-swift#readme", + "devDependencies": { + "@semantic-release/changelog": "^6.0.2", + "@semantic-release/exec": "^6.0.3", + "@semantic-release/git": "^10.0.1", + "semantic-release": "^19.0.5", + "semantic-release-slack-bot": "^3.5.3" + }, + "release": { + "branches": [ + { + "name": "main" + }, + { + "name": "prerelease/*", + "prerelease": "snapshot" + } + ], + "tagFormat": "${version}", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/exec", + { + "prepareCmd": "npm version ${nextRelease.version} --git-tag-version false" + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md", + "package.json", + "package-lock.json" + ], + "message": "chore(release): cut wallet sdk swift ${nextRelease.version} release\n\n${nextRelease.notes}" + } + ], + [ + "semantic-release-slack-bot", + { + "notifyOnSuccess": true, + "notifyOnFail": true, + "markdownReleaseNotes": true, + "onSuccessTemplate": { + "text": "A new version of Swift Wallet SDK successfully released!\nVersion: `$npm_package_version`\nTag: $repo_url/releases/tag/$npm_package_version\n\nRelease notes:\n$release_notes" + } + } + ] + ] + } +}