Skip to content

Commit

Permalink
Update release job
Browse files Browse the repository at this point in the history
  • Loading branch information
crow committed Nov 16, 2024
1 parent c379e33 commit b0eb0c4
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
required: false
type: boolean
default: false
version:
description: 'Version number (e.g., 1.0.0)'
required: true

env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
Expand Down Expand Up @@ -44,7 +47,13 @@ jobs:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
VERSION="${{ github.ref#refs/tags/ }}"
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get the release notes
id: get_release_notes
env:
Expand All @@ -54,12 +63,12 @@ jobs:
{
echo "NOTES<<${delimiter}"
awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md
echo ${delimiter}
echo "${delimiter}"
} >> $GITHUB_OUTPUT
publish:
needs: [ prepare-release ]
if: ${{ !inputs.dry_run }}
if: ${{ github.event.inputs.dry_run != 'true' }}
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
Expand All @@ -68,7 +77,7 @@ jobs:

publish-check:
needs: [ prepare-release ]
if: ${{ inputs.dry_run }}
if: ${{ github.event.inputs.dry_run == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -81,7 +90,7 @@ jobs:
create-github-release:
runs-on: ubuntu-latest
needs: [ prepare-release, publish ]
if: ${{ !inputs.dry_run }}
if: ${{ github.event.inputs.dry_run != 'true' }}
steps:
- uses: actions/checkout@v3
- name: Github Release
Expand All @@ -91,7 +100,7 @@ jobs:
with:
tag_name: ${{ needs.prepare-release.outputs.version }}
release_name: ${{ needs.prepare-release.outputs.version }}
body: ${{ needs.prepare-release.outputs.NOTES }}
body: ${{ needs.prepare-release.outputs.release_notes }}
draft: false
prerelease: false

Expand All @@ -106,12 +115,18 @@ jobs:
release-docs:
runs-on: macos-14-xlarge
needs: [ publish ]
if: ${{ !inputs.dry_run }}
if: ${{ github.event.inputs.dry_run != 'true' }}
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
VERSION="${{ github.ref#refs/tags/ }}"
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- uses: actions/setup-java@v2
with:
Expand Down

0 comments on commit b0eb0c4

Please sign in to comment.