-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci.yml: Prereleases have spack environments of the form `<model>-pr<PR number>-<build> * pr-closed.yml: Now use the updated undeploy workflow
- Loading branch information
Showing
2 changed files
with
29 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,34 +153,34 @@ jobs: | |
- check-spack-yaml | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.get-version.outputs.version-name }} | ||
version-build: ${{ steps.get-version-build.outputs.version-build-name }} | ||
release: ${{ steps.get-release.outputs.version }} | ||
prerelease: ${{ steps.get-prerelease.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Generate Version Number | ||
id: get-version | ||
- name: Generate Release Version | ||
id: get-release | ||
# The step generates a general version number from the spack.yaml, looking the | ||
# same as a regular release build. | ||
# Ex. '[email protected]' -> '2024.01.1' | ||
# Ex. 'access-om2-bgc@git.2024.01.1' -> '2024.01.1' | ||
run: | | ||
access_om2_package=$(yq e '${{ env.SPACK_YAML_MODEL_YQ }}' spack.yaml) | ||
echo "version-name=${access_om2_package/*@git./}" >> $GITHUB_OUTPUT | ||
echo "version=${access_om2_package/*@git./}" >> $GITHUB_OUTPUT | ||
- name: Generate Version-Build String | ||
id: get-version-build | ||
- name: Generate Prerelease Version | ||
id: get-prerelease | ||
# This step generates the version number for prereleases, | ||
# which looks like: `<version>-<number of commits on this branch>`. | ||
# Ex. `2024.10.1` with 2 commits on branch -> `2024.10.1-2`. | ||
# which looks like: `pr<pull request number>-<number of commits on this branch>`. | ||
# Ex. Pull Request #12 with 2 commits on branch -> `pr12-2`. | ||
run: | | ||
number_of_commits=$(git rev-list --count ${{ github.event.pull_request.base.sha }}..HEAD) | ||
echo "version-build-name=${{ steps.get-version.outputs.version-name }}-${number_of_commits}" >> $GITHUB_OUTPUT | ||
echo "version=pr${{ github.event.pull_request.number }}-${number_of_commits}" >> $GITHUB_OUTPUT | ||
update-prerelease-tag: | ||
name: Update Prerelease Tag ${{ needs.get-versions.outputs.version }} | ||
name: Update Prerelease Tag ${{ needs.get-versions.outputs.release }} | ||
needs: | ||
- get-versions | ||
runs-on: ubuntu-latest | ||
|
@@ -196,16 +196,16 @@ jobs: | |
run: | | ||
git config user.name ${{ vars.GH_ACTIONS_BOT_GIT_USER_NAME }} | ||
git config user.email ${{ vars.GH_ACTIONS_BOT_GIT_USER_EMAIL }} | ||
git tag ${{ needs.get-versions.outputs.version }} --force | ||
git tag ${{ needs.get-versions.outputs.release }} --force | ||
git push --tags --force | ||
# ----------------------------- | ||
# | PRERELEASE DEPLOYMENT JOB | | ||
# ----------------------------- | ||
prerelease-deploy: | ||
name: Deploy to Prerelease | ||
# This will create a `spack` environment with the name `access-om2-<version>-<commit number>`. | ||
# For example, `access-om2-2024_01_1-3` for the deployment based on the third commit on the PR branch. | ||
# This will create a `spack` environment with the name `access-om2-bgc-pr<PR number>-<commit number>`. | ||
# For example, `access-om2-bgc-pr12-3` for the deployment based on the third commit on the 12th PR. | ||
needs: | ||
- get-versions # so we can give an appropriate version to the prerelease build | ||
- update-prerelease-tag # implies all the spack.yaml-related checks have passed | ||
|
@@ -214,7 +214,7 @@ jobs: | |
with: | ||
type: prerelease | ||
ref: ${{ github.head_ref }} | ||
version: ${{ needs.get-versions.outputs.version-build }} | ||
version: ${{ needs.get-versions.outputs.prerelease }} | ||
secrets: inherit | ||
|
||
notifier: | ||
|
@@ -237,8 +237,8 @@ jobs: | |
GH_REPO: ${{ github.repository }} | ||
BODY: | | ||
This `${{ github.repository }}` model will be deployed with the following versions: | ||
* `${{ needs.get-versions.outputs.version }}` as a Release (when merged). | ||
* `${{ needs.get-versions.outputs.version-build }}` as a Prerelease (during this PR). This can be accessed on `Gadi` via `spack` at `/g/data/vk83/prerelease/apps/spack/0.20/spack` once deployed. | ||
* `${{ needs.get-versions.outputs.release }}` as a Release (when merged). | ||
* `${{ needs.get-versions.outputs.prerelease }}` as a Prerelease (during this PR). This can be accessed on `Gadi` via `spack` at `/g/data/vk83/prerelease/apps/spack/0.20/spack` once deployed. | ||
It will be deployed using: | ||
* `access-nri/spack-packages` version [`${{ needs.check-json.outputs.spack-packages-version }}`](https://github.com/ACCESS-NRI/spack-packages/releases/tag/${{ needs.check-json.outputs.spack-packages-version }}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters