Skip to content

Commit

Permalink
Merge "Build and Test" and "Publish" release jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 18, 2021
1 parent d0b6f0f commit 983f882
Showing 1 changed file with 5 additions and 26 deletions.
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

0 comments on commit 983f882

Please sign in to comment.