Skip to content

Create Draft Release (1.2.4) #264

Create Draft Release (1.2.4)

Create Draft Release (1.2.4) #264

---
name: Create Draft Release
run-name: Create Draft Release (${{ github.ref_name }})
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+**'
# prevent multiple releases from running at the same time
concurrency:
group: ${{ github.workflow_ref }}-${{ github.ref_name }}
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Draft Release
id: release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
updateOnlyUnreleased: true # prevent modifying any non-draft non-prerelease
removeArtifacts: true # deletes any existing artifacts when modifying
draft: true
tag: ${{ github.ref_name }}
commit: ${{ github.sha }}
name: Cloudtruth CLI ${{ github.ref_name }}
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Cargo and tag version alignment
env:
TAG_VERSION: ${{ github.ref_name }}
run: |
CARGO_VERSION="$(cargo pkgid | cut -d@ -f2 )"
echo "CARGO_VERSION=${CARGO_VERSION}"
echo "TAG_VERSION=${TAG_VERSION}"
[ ! -z "$CARGO_VERSION" ]
echo "${{ github.ref_name }}" | grep "${CARGO_VERSION}"
outputs:
releaseId: ${{ steps.release.outputs.id }}
releaseUploadUrl: ${{ steps.release.outputs.upload_url }}
build-release:
name: Build Release
needs: create-release
uses: ./.github/workflows/build-release.yml
with:
releaseId: ${{ needs.create-release.outputs.releaseId }}
releaseUploadUrl: ${{ needs.create-release.outputs.releaseUploadUrl }}
test-release:
name: Test Release
needs: [create-release, build-release]
uses: ./.github/workflows/test-release.yml
with:
releaseId: ${{ needs.create-release.outputs.releaseId }}
releaseVersion: ${{ github.ref_name }}
secrets:
CLOUDTRUTH_API_KEY: ${{ secrets.CI_ACCT_READONLY_CT_API_KEY}}