Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge bbrelease to release #3232

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 63 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ on:
type: string
required: false
default: snapshot
use_environ:
description: 'Environment to locate files'
type: choice
required: true
default: snapshots
options:
- snapshots
- release

permissions:
contents: read
Expand All @@ -29,35 +21,84 @@ jobs:
steps:
- run: |
echo "Tag: $TAG"
echo "Environment: $ENVIRONMENT"
env:
TAG: ${{ inputs.tag }}
ENVIRONMENT: ${{ inputs.environment }}
TAG: ${{ inputs.use_tag }}

call-workflow-tarball:
- name: "Determine tag"
if: "${{ github.event_name }} == 'push' && ${{ github.ref_type }} == 'tag'"
run: |
"echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
"echo \"RELEASE_SHA=$(git rev-parse --short \"$GITHUB_SHA\")\" >> $GITHUB_ENV"
shell: "bash"

# tarball.yml will be used for releases when pre-tag actions are implemented
# call-workflow-tarball:
# needs: log-the-inputs
# uses: ./.github/workflows/tarball.yml
# with:
# use_tag: ${{ inputs.use_tag }}
# use_environ: release

create-files-ctest:
needs: log-the-inputs
uses: ./.github/workflows/tarball.yml
with:
use_tag: ${{ inputs.use_tag }}
use_environ: ${{ inputs.use_environ }}
runs-on: ubuntu-latest
steps:
- name: Set file base name
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ needs.log-the-inputs.outputs.TAG }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@v3
with:
path: ${{ steps.set-file-base.outputs.FILE_BASE }}

- name: Zip Folder
run: |
zip -r ${{ steps.get-file-base.outputs.FILE_BASE }}.zip ./${{ steps.get-file-base.outputs.FILE_BASE }}
tar -zcvf ${{ steps.get-file-base.outputs.FILE_BASE }}.tag.gz ./${{ steps.get-file-base.outputs.FILE_BASE }}

- name: List files in the repository
run: |
ls -l ${{ github.workspace }}
ls $GITHUB_WORKSPACE

# Save files created by release script
- name: Save tgz-tarball
uses: actions/upload-artifact@v3
with:
name: tgz-tarball
path: ${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Save zip-tarball
uses: actions/upload-artifact@v3
with:
name: zip-tarball
path: ${{ steps.set-file-base.outputs.FILE_BASE }}.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

call-workflow-ctest:
needs: call-workflow-tarball
needs: create-files-ctest
uses: ./.github/workflows/cmake-ctest.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
file_base: ${{ needs.create-files-ctest.outputs.file_base }}
use_tag: ${{ inputs.use_tag }}
use_environ: ${{ inputs.use_environ }}

call-workflow-release:
needs: [call-workflow-tarball, call-workflow-ctest]
#needs: [call-workflow-tarball, call-workflow-ctest]
needs: [log-the-inputs, call-workflow-ctest]
permissions:
contents: write # In order to allow tag creation
uses: ./.github/workflows/release-files.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
file_branch: ${{ needs.call-workflow-tarball.outputs.file_branch }}
file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }}
file_base: ${{ needs.create-files-ctest.outputs.file_base }}
file_branch: ${{ needs.log-the-inputs.outputs.TAG }}
file_sha: ${{ needs.log-the-inputs.outputs.RELEASE_SHA }}
use_tag: ${{ inputs.use_tag }}
use_environ: ${{ inputs.use_environ }}

Loading