Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge "Build and Test" and "Publish" release jobs #12818

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 5 additions & 26 deletions .github/workflows/release.yml
Expand Up @@ -31,24 +31,6 @@ jobs:
git diff --name-only HEAD^..HEAD
fi;

build:
name: Build and Test
runs-on: ubuntu-latest
needs: log-updates
steps:
- uses: actions/checkout@v2
- name: Build and Test
run: make prepublish
- uses: actions/upload-artifact@v2
with:
name: build-artifact
path: |
codemods/*/**/*
eslint/*/**/*
packages/*/**/*
!**/test/**
!**/node_modules/**

git-version:
name: Create git tag and commit
runs-on: ubuntu-latest
Expand Down Expand Up @@ -79,14 +61,13 @@ jobs:
git push "https://babel-bot:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:"$branch" --follow-tags

npm-release:
name: Publish release on npm
name: Build, Test and Publish
runs-on: ubuntu-latest
needs: [git-version, build]
needs: git-version
environment: npm
# The default condition is success(), but this is false when one of the previous jobs is skipped
if: |
always() &&
needs.build.result == 'success' &&
(needs.git-version.result == 'success' || needs.git-version.result == 'skipped')
steps:
- uses: actions/checkout@v2
Expand All @@ -96,9 +77,8 @@ jobs:
if: needs.git-version.result == 'success'
run: git checkout ${{ needs.git-version.outputs.branch }}

- uses: actions/download-artifact@v2
with:
name: build-artifact
- name: Build and Test
run: make prepublish

- name: Publish to npm
run: yarn release-tool publish --yes
Expand All @@ -108,11 +88,10 @@ jobs:
github-release:
name: Create GitHub release draft
runs-on: ubuntu-latest
needs: [git-version, build]
needs: git-version
# The default condition is success(), but this is false when one of the previous jobs is skipped
if: |
always() &&
needs.build.result == 'success' &&
(needs.git-version.result == 'success' || needs.git-version.result == 'skipped')
outputs:
is-main: ${{ steps.is-main.outputs.result == 1 }}
Expand Down