Update rust.yml
This commit is contained in:
1 parent
d38f5a51da
commit
f8b896092c
1 file changed
+11
-4
@@ -55,8 +55,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# This job only runs on a successful push to the master branch
|
# This job only runs on a successful push to the master branch
|
||||||
if: success() && github.ref == 'refs/heads/master'
|
if: success() && github.ref == 'refs/heads/master'
|
||||||
env:
|
|
||||||
NIGHTLY_REPO: ${{ github.repository_owner }}/pumpkin-commit-builds
|
|
||||||
outputs:
|
outputs:
|
||||||
release-id: ${{ steps.create-release.outputs.release-id }}
|
release-id: ${{ steps.create-release.outputs.release-id }}
|
||||||
steps:
|
steps:
|
||||||
@@ -65,18 +63,27 @@ jobs:
|
|||||||
- name: Create Release Draft
|
- name: Create Release Draft
|
||||||
id: create-release
|
id: create-release
|
||||||
env:
|
env:
|
||||||
|
NIGHTLY_REPO: ${{ github.repository_owner }}/pumpkin-commit-builds
|
||||||
GITHUB_TOKEN: ${{ secrets.COMMIT_REPO_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.COMMIT_REPO_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
RELEASE_TAG="per-commit-${{ github.sha }}"
|
RELEASE_TAG="per-commit-${{ github.sha }}"
|
||||||
RELEASE_TITLE="Build ${{ github.sha }}"
|
RELEASE_TITLE="Build ${{ github.sha }}"
|
||||||
REPO_NAME="${{ env.NIGHTLY_REPO }}"
|
REPO_NAME="${{ env.NIGHTLY_REPO }}"
|
||||||
echo "Creating draft release with tag: ${RELEASE_TAG} in repo: ${REPO_NAME}"
|
echo "Creating draft release with tag: ${RELEASE_TAG} in repo: ${REPO_NAME}"
|
||||||
RELEASE_URL=$(gh release create "${RELEASE_TAG}" \
|
|
||||||
|
# Create the release and get the ID in a single, reliable command
|
||||||
|
RELEASE_ID=$(gh release create "${RELEASE_TAG}" \
|
||||||
--draft \
|
--draft \
|
||||||
--title "${RELEASE_TITLE}" \
|
--title "${RELEASE_TITLE}" \
|
||||||
--notes "Per-commit build based on ${{ github.repository }}@${{ github.sha }}" \
|
--notes "Per-commit build based on ${{ github.repository }}@${{ github.sha }}" \
|
||||||
--repo "${REPO_NAME}")
|
--repo "${REPO_NAME}")
|
||||||
RELEASE_ID=$(gh release view "${RELEASE_TAG}" --repo "${REPO_NAME}" --json id | jq -r '.id')
|
|
||||||
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "Failed to create release or retrieve release ID."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Release-ID:${RELEASE_ID}"
|
||||||
echo "release-id=${RELEASE_ID}" >> ${GITHUB_OUTPUT}
|
echo "release-id=${RELEASE_ID}" >> ${GITHUB_OUTPUT}
|
||||||
|
|
||||||
# Job to build the project in release mode and upload the artifacts
|
# Job to build the project in release mode and upload the artifacts
|
||||||
|
|||||||
Reference in new issue
Block a user