on: push: tags: - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 name: Release workflow jobs: release: name: Create a release runs-on: ubuntu-latest permissions: contents: write outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} draft: true publish-to-npm: name: Publish to npm runs-on: ubuntu-latest needs: release permissions: id-token: write steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-mise - name: Install dependencies run: yarn install --immutable - name: Build run: yarn build - name: Publish packages to npm run: yarn run -T lerna publish from-package --yes --no-verify-access - name: Add latest-eas-build-staging tag env: NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} run: | VERSION=$(cat lerna.json | jq -r .version) echo //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN > ~/.npmrc npm dist-tag add eas-cli@$VERSION latest-eas-build-staging - name: Add latest-eas-build tag env: NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} run: | VERSION=$(cat lerna.json | jq -r .version) echo //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN > ~/.npmrc npm dist-tag add eas-cli@$VERSION latest-eas-build release-changelog: name: Update changelog and publish release runs-on: ubuntu-latest needs: publish-to-npm permissions: contents: write steps: - uses: actions/checkout@v4 with: token: ${{ secrets.EXPO_BOT_PAT }} - uses: ./.github/actions/setup-mise - name: Install dependencies working-directory: ./scripts run: yarn install --immutable - name: Resolve version run: echo "EAS_CLI_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - name: Update changelog working-directory: ./scripts run: yarn release-changelog $EAS_CLI_VERSION > /tmp/current-changelog - name: Publish release run: gh release edit v$EAS_CLI_VERSION --draft=false -F /tmp/current-changelog env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Commit and push run: | git fetch git checkout main git config --global user.email "support+ci@expo.io" git config --global user.name "Expo CI" git add CHANGELOG.md git commit --allow-empty -m "update CHANGELOG.md" git push - name: Prepare changelog for Slack run: | tail -n +3 /tmp/current-changelog > /tmp/changelog.md npx slackmd /tmp/changelog.md echo 'SLACK_CHANGELOG<> $GITHUB_ENV cat /tmp/changelog.slack.md >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV - name: Slack Notification uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: eas-cli SLACK_COLOR: ${{ job.status }} SLACK_ICON: https://github.com/expo-bot.png?size=48 SLACK_TITLE: "Released eas-cli@${{ env.EAS_CLI_VERSION }}" SLACK_MESSAGE: ${{ env.SLACK_CHANGELOG }} SLACK_USERNAME: "EAS CLI CI" SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_FOOTER: ""