feat: force new release #4
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
name: Release Pipeline | |
on: | |
push: | |
branches: [main, beta, alpha] | |
workflow_dispatch: | |
env: | |
APP_NAME: Place.API | |
SOLUTION: Place.sln | |
API_PROJECT: src/Place.API/Place.API.csproj | |
jobs: | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
issues: write | |
pull-requests: write | |
outputs: | |
new_release_published: ${{ steps.semantic.outputs.new_release_published }} | |
new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
- name: Install semantic-release | |
run: | | |
npm install -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/exec conventional-changelog-angular | |
- name: Debug Semantic Release | |
id: semantic | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Running semantic-release in debug mode" | |
npx semantic-release --debug | |
# Capture the result explicitly | |
if [ $? -eq 0 ]; then | |
echo "new_release_published=true" >> $GITHUB_OUTPUT | |
# Get the latest tag for version | |
VERSION=$(git describe --tags --abbrev=0) | |
echo "new_release_version=${VERSION}" >> $GITHUB_OUTPUT | |
else | |
echo "new_release_published=false" >> $GITHUB_OUTPUT | |
fi | |
build-and-publish: | |
needs: release | |
if: needs.release.outputs.new_release_published == 'true' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Debug Outputs | |
run: | | |
echo "Release published: ${{ needs.release.outputs.new_release_published }}" | |
echo "Release version: ${{ needs.release.outputs.new_release_version }}" | |
# Rest of your build steps... |