Skip to content
Open
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
27 changes: 17 additions & 10 deletions .github/workflows/create_version_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ on:
jobs:
monthly_release:
runs-on: ubuntu-latest
outputs:
version_name: ${{ steps.set_version_name.outputs.version_name }}
steps:
#checkout main branch
- name: Checkout code
Expand Down Expand Up @@ -63,15 +65,20 @@ jobs:
fi
# Create version name accessible in the following steps
- name: Set version name
id: set_version_name
run: |
echo "VERSION_NAME=v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-$(date +'%Y.%m.%d')" >> $GITHUB_ENV
# Use format vMAJOR.MINOR.PATCH-YY.MM e.g., v1.2.3-24.06 for June 2024
VERSION_NAME="v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-$(date +'%y.%m')"
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "version_name=$VERSION_NAME" >> $GITHUB_OUTPUT
echo "VERSION_NAME=$VERSION_NAME"
# Create a new version tag
- name: Create version tag
run: |
git config user.email "t8ddy.bot@gmail.com"
git config user.name "t8ddy"
# configure remote to use the secret token for pushing
git remote set-url origin https://x-access-token:${{ secrets.T8DDY_TOKEN }}@github.com/${{ github.repository }}
git tag "${{ env.VERSION_NAME }}"
git push origin --tags

t8code_tarball:
uses: ./.github/workflows/test_tarball.yml
needs: monthly_release
secrets: inherit
with:
TEST_LEVEL: 'T8_TEST_LEVEL_BASIC'
RELEASE_VERSION: ${{ needs.monthly_release.outputs.version_name }}
UPLOAD_TO_RELEASE: true

26 changes: 25 additions & 1 deletion .github/workflows/test_tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ on:
type: string
description: 'Test level used for configuring (T8_TEST_LEVEL_FULL, T8_TEST_LEVEL_MEDIUM, or T8_TEST_LEVEL_BASIC)'
default: 'T8_TEST_LEVEL_FULL'
RELEASE_VERSION:
required: false
type: string
description: 'Create a release with this version (e.g., v1.2.3-24.06) and upload the tarball to it'
UPLOAD_TO_RELEASE:
required: false
type: boolean
description: 'Whether to upload the tarball to the release'
default: false

jobs:
build_tarball:

if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
container: dlramr/t8code-ubuntu:t8-dependencies
Expand Down Expand Up @@ -139,5 +147,21 @@ jobs:
with:
name: build_tar.log
path: build_tar/test-suite.log
- name: retrieve name of tarball
run: |
TAR_NAME=$(basename tarballs/*.tar.gz)
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
- name: upload as release asset
if: ${{ inputs.UPLOAD_TO_RELEASE == true }}
uses: ncipollo/release-action@v1
with:
name: ${{ inputs.RELEASE_VERSION }}
commit: main
tag: ${{ inputs.RELEASE_VERSION }}
artifacts: "tarballs/*.tar.gz"
body: "Automated release of t8code version ${{ inputs.RELEASE_VERSION }} created from tarball tested in CI."
generate_release_notes: true
token: ${{ secrets.T8DDY_TOKEN }}