mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-15 17:31:46 -10:00
104 lines
3.7 KiB
YAML
104 lines
3.7 KiB
YAML
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@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # 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 "[email protected]"
|
|
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<<EOF' >> $GITHUB_ENV
|
|
cat /tmp/changelog.slack.md >> $GITHUB_ENV
|
|
echo 'EOF' >> $GITHUB_ENV
|
|
- name: Slack Notification
|
|
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 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: ""
|