Conversation
|
Depends on: #102 |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RELEASE_TAG: 'agentapi_${{ github.event.pull_request.number }}' | ||
|
|
||
| run: gh release upload "$RELEASE_TAG" "$GITHUB_WORKSPACE"/out/* --clobber |
There was a problem hiding this comment.
Will this be a draft release? Also can we make this release not latest.
There was a problem hiding this comment.
I don't think we are setting it as latest in this workflow. Even in normal releases, we set the latest manually.
There was a problem hiding this comment.
We can test it out once #102 is reviewed and merged.
matifali
left a comment
There was a problem hiding this comment.
LGTM. We should eventually merge this into a single release workflow that we can run conditionally on PRs too.
| make gen | ||
| ./check_unstaged.sh | ||
|
|
||
| - name: Build and Upload |
There was a problem hiding this comment.
| - name: Build and Upload | |
| - name: Build |
| "linux arm64 agentapi-linux-arm64" | ||
| "darwin amd64 agentapi-darwin-amd64" | ||
| "darwin arm64 agentapi-darwin-arm64" | ||
| "windows amd64 agentapi-windows-amd64.exe" |
There was a problem hiding this comment.
do we not build for arm64 windows?
|
|
||
| - name: Read PR number | ||
| id: pr | ||
| run: echo "number=$(cat number)" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
| run: echo "number=$(cat number)" >> $GITHUB_OUTPUT | |
| run: echo "number=${number}" >> $GITHUB_OUTPUT |
Also, where does number come from? Should this be pr-number?
There was a problem hiding this comment.
@johnstcn the number comes from the downloaded artifact (that is uploaded by pr-preview-build)
| # Check if release exists | ||
| if gh release view "$RELEASE_TAG" &>/dev/null; then | ||
| echo "Updating release $RELEASE_TAG" | ||
| gh release upload "$RELEASE_TAG" "$GITHUB_WORKSPACE"/out/* --clobber | ||
| else | ||
| echo "Creating release $RELEASE_TAG" | ||
| gh release create "$RELEASE_TAG" "$GITHUB_WORKSPACE"/out/* \ | ||
| --title "$RELEASE_TAG" \ | ||
| --notes "Preview release for PR #${PR_NUMBER}" \ | ||
| --draft --latest=false | ||
| fi |
There was a problem hiding this comment.
We should validate the release tag before performing any actions e.g. it should start with preview- or similar.
| if gh release view "$RELEASE_TAG" &>/dev/null; then | ||
| echo "Updating release $RELEASE_TAG" | ||
| gh release upload "$RELEASE_TAG" "$GITHUB_WORKSPACE"/out/* --clobber | ||
| else |
There was a problem hiding this comment.
You can just exit 0 here if there's nothing else to do, then you don't need the else.
There was a problem hiding this comment.
The else contains the logic for the first release
echo "Creating release $RELEASE_TAG"
gh release create "$RELEASE_TAG" "$GITHUB_WORKSPACE"/out/* \
--title "$RELEASE_TAG" \
--notes "Preview release for PR #${PR_NUMBER}" \
--draft --latest=false
| - name: Upload PR number | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | ||
| with: | ||
| name: pr-number |
There was a problem hiding this comment.
Can't you use github.event.pull_request.number here?
There was a problem hiding this comment.
No, in the pr-preview-release until i don't download this artifact I won't be knowing about the pr number that triggered pr-preview-build.
dbb3d54 to
c01d334
Compare
Closes: #100