fix: add needs #2
This file contains 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
# Workflow to run on the main branch | ||
name: main QA and release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yml | ||
release: | ||
needs: [test] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_tag_version: ${{ steps.tag_version.outputs.new_tag_version }} | ||
steps: | ||
- name: Checkout π | ||
uses: actions/checkout@master | ||
- name: Setup node env π | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
check-latest: true | ||
- name: Install dependencies π¨π»β | ||
run: yarn install | ||
- name: Dry run to get the next release version | ||
id: tag_version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
export NEXT_TAG_VERSION=$(npx semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/') | ||
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT | ||
- name: Release π | ||
run: yarn release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Version | ||
run: echo "The version is ${{ steps.tag_version.outputs.new_tag_version }}" | ||
publish: | ||
needs: [test, release] | ||
uses: ./.github/workflows/docker-build.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.release.outputs.new_tag_version}} | ||
push: true |