Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
pre rel check.
Browse files Browse the repository at this point in the history
  • Loading branch information
RossBugginsNHS authored Jun 26, 2024
1 parent 5ad469d commit b4cd135
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cicd-1-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
python_version: ${{ steps.variables.outputs.python_version }}
terraform_version: ${{ steps.variables.outputs.terraform_version }}
version: ${{ steps.variables.outputs.version }}
is_version_prerelease: ${{ steps.pr_exists.outputs.is_version_prerelease }}
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
steps:
- name: "Checkout code"
Expand All @@ -42,6 +43,8 @@ jobs:
echo "python_version=$(grep "^nodejs" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "terraform_version=$(grep "^terraform" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
echo "is_version_prerelease=$(if [[ $a == *-* ]] then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT
- name: "Check if pull request exists for this branch"
id: pr_exists
env:
Expand Down Expand Up @@ -98,7 +101,7 @@ jobs:
name: "Build stage"
needs: [metadata, test-stage]
uses: ./.github/workflows/stage-3-build.yaml
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')) || (github.event.action == 'push' && github.ref == 'refs/heads/main')
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')) || (github.event_name == 'push' && github.ref == 'refs/heads/main')
with:
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
Expand All @@ -112,7 +115,7 @@ jobs:
name: "Acceptance stage"
needs: [metadata, build-stage]
uses: ./.github/workflows/stage-4-acceptance.yaml
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')) || (github.event.action == 'push' && github.ref == 'refs/heads/main')
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')) || (github.event_name == 'push' && github.ref == 'refs/heads/main')
with:
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
Expand All @@ -135,4 +138,5 @@ jobs:
python_version: "${{ needs.metadata.outputs.python_version }}"
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
version: "${{ needs.metadata.outputs.version }}"
is_version_prerelease: "${{ needs.metadata.outputs.is_version_prerelease }}"
secrets: inherit
18 changes: 15 additions & 3 deletions .github/workflows/stage-5-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ on:
description: "Version of the software, set by the CI/CD pipeline workflow"
required: true
type: string

is_version_prerelease:
description: "Is this a semantically versioned pre release, set by the CI/CD pipeline workflow"
required: true
type: string
jobs:
publish:
name: "Publish packages"
Expand All @@ -57,7 +60,7 @@ jobs:
body: |
Release of ${{ inputs.version }}
draft: false
prerelease: false
prerelease: ${{ inputs.is_version_prerelease }}
- name: "Upload jeykll docs release asset"
uses: actions/upload-release-asset@v1
env:
Expand All @@ -67,7 +70,16 @@ jobs:
asset_path: ./artifacts
asset_name: jekyll-docs-${{ inputs.version }}.tar.gz
asset_content_type: "application/gzip"
# - name: "Upload release asset"
# - name: "Upload other release asset 1"
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: "${{ steps.create_release.outputs.upload_url }}"
# asset_path: ./*
# asset_name: repository-template-${{ inputs.version }}.tar.gz
# asset_content_type: "application/gzip"
# - name: "Upload other release asset 2"
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit b4cd135

Please sign in to comment.