Skip to content

Commit

Permalink
fix(69): changed cross job reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Reich committed Mar 4, 2025
1 parent 9283a6a commit 6b5820a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
# needs: [test]
runs-on: ubuntu-latest
name: semantic-release
outputs:
RELEASE_TAG: ${{ steps.release.outputs.RELEASE_TAG }}
RELEASE_VERSION: ${{ steps.release.outputs.RELEASE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -23,14 +26,10 @@ jobs:
- name: Install dependencies
run: npm install @semantic-release/[email protected] @semantic-release/[email protected] @semantic-release/[email protected] @semantic-release/[email protected] @semantic-release/[email protected] [email protected] --save-dev
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically created by GH action
run: |
npx semantic-release # npx is included in npm -> Ubuntu
VERSION=$(cat VERSION)
GIT_TAG=$(cat GIT_TAG)
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "RELEASE_TAG=$GIT_TAG" >> $GITHUB_OUTPUT
run: npx semantic-release # npx is included in npm -> Ubuntu

delivery:
runs-on: ubuntu-latest
Expand All @@ -41,7 +40,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ steps.semantic-release.outputs.RELEASE_TAG }}
ref: ${{ needs.semantic-release.outputs.RELEASE_TAG }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -51,8 +50,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Print release tag name
run: |
echo "Release tag name: ${{ steps.semantic-release.outputs.RELEASE_TAG }}"
echo "Release tag name: ${{ steps.semantic-release.outputs.RELEASE_VERSION }}"
echo "Release tag name: ${{ needs.semantic-release.outputs.RELEASE_TAG }}"
echo "Release tag name: ${{ needs.semantic-release.outputs.RELEASE_VERSION }}"
- name: Build and push
uses: docker/build-push-action@v6
Expand All @@ -62,4 +61,4 @@ jobs:
push: true
tags: |
ghcr.io/maibornwolff/license-policy-check:latest
ghcr.io/maibornwolff/license-policy-check:${{ steps.semantic-release.outputs.RELEASE_VERSION }}
ghcr.io/maibornwolff/license-policy-check:${{ needs.semantic-release.outputs.RELEASE_VERSION }}
5 changes: 3 additions & 2 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ plugins:
- "@semantic-release/github"
- - "@semantic-release/exec"
- successCmd: |
echo ${nextRelease.version} > VERSION
echo ${nextRelease.gitTag} > GIT_TAG
echo "RELEASE_VERSION=${nextRelease.version}" >> "$GITHUB_OUTPUT"
echo "RELEASE_TAG=${nextRelease.gitTag}" >> "$GITHUB_OUTPUT"
echo "setting env variables done"

0 comments on commit 6b5820a

Please sign in to comment.