This repository was archived by the owner on Jun 23, 2025. It is now read-only.
Merge pull request #84 from superwall/feat/add-storekit-option #21
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: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Pack | |
| run: npm pack | |
| - name: Publish | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| tag: | |
| needs: npm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Tag | |
| run: | | |
| sudo git config --global user.name 'Jake' | |
| sudo git config --global user.email 'jakemor@users.noreply.github.com' | |
| sudo git pull | |
| echo "\n\n\n- - - - - VERSION - - - - -\n\n\n" | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo $VERSION | |
| echo "\n\n\n- - - - - END VERSION - - - - -\n\n\n" | |
| sudo git tag -a $VERSION -m "tags with latest version" | |
| sudo git push --tags || true | |
| sudo git checkout -b release/$VERSION | |
| sudo git push -u origin release/$VERSION | |
| slack: | |
| runs-on: ubuntu-latest | |
| needs: tag | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Parse version | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=$VERSION" | |
| echo "::set-output name=prop::$VERSION" | |
| - name: Determine prerelease status | |
| id: prerelease | |
| run: | | |
| VERSION=${{ steps.version.outputs.prop }} | |
| if [[ "$VERSION" == *"-alpha"* || "$VERSION" == *"-beta"* || "$VERSION" == *"-rc"* ]]; then | |
| echo "::set-output name=status::true" | |
| else | |
| echo "::set-output name=status::false" | |
| fi | |
| - name: slack-send | |
| uses: slackapi/slack-github-action@v1.24.0 | |
| with: | |
| payload: | | |
| { | |
| "text": "Please create a new React Native Release! https://github.com/superwall/react-native-superwall/releases/new?tag=${{ steps.version.outputs.prop }}&prerelease=${{ steps.prerelease.outputs.status }}" | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |