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

build: Update version management scripts and control #2028

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from
Draft
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
5 changes: 2 additions & 3 deletions .github/workflows/_publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
env:
HARBOR_USER: ${{ secrets.HARBOR_USER }}
HARBOR_SECRET: ${{ secrets.HARBOR_SECRET }}
- name: Update Version Information
uses: "./.github/workflows/update-release-info"
- name: Submit PR with Updated Version Information
uses: "./.github/workflows/set-latest-release-point"
if: ${{ inputs.publishType == 'release' }}
with:
createPR: ${{ ! endsWith(github.ref, 'pre') }}
releaseVersion: ${{ env.dissolveVersion }}
26 changes: 26 additions & 0 deletions .github/workflows/latest-release-point.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Latest Release Point

on:
push:
branches:
- 'develop'
paths:
- 'README.md'

jobs:

SetTag:
runs-on: ubuntu-latest
steps:
- name: Checkout
if: startsWith(${{ github.event.push.head_commit.message }}, "[Latest Release]")
uses: actions/checkout@v4
- name: Move Tag
if: startsWith(${{ github.event.push.head_commit.message }}, "[Latest Release]")
shell: bash
run: |
git tag -d latest-release-point
git tag latest-release-point ${{ github.event.push.head_commit }}
git show latest-release-point
git push --force origin latest-release-point

37 changes: 37 additions & 0 deletions .github/workflows/set-latest-release-point/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update Release Info
description: List releases and update website info

inputs:
repository:
type: string
default: disorderedmaterials/dissolve
createPR:
type: boolean
default: true
releaseVersion:
type: string

runs:
using: "composite"
steps:

- name: Checkout Develop
uses: actions/checkout@v4
with:
ref: develop

- name: Update Version in README.md
shell: bash
run: |
./changeversion -r ${{ inputs.releaseVersion }}

- name: Create Update PR
uses: peter-evans/create-pull-request@v4
with:
base: develop
add-paths: README.md
commit-message: Update version in README.md
delete-branch: true
branch: automation/update-current-release-to-${{ inputs.releaseVersion }}
title: [Latest Release] Update README.md release info (v${{ inputs.releaseVersion }})
reviewers: trisyoungs
2 changes: 1 addition & 1 deletion .github/workflows/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:
shell: bash
run: |
set -ex
DISSOLVE_VERSION=`grep "#define DISSOLVEVERSION" src/main/version.cpp | sed 's/.*\"\(.*\)\"/\1/g'`
DISSOLVE_VERSION=$(./changeversion -v)
echo "Dissolve code version is ${DISSOLVE_VERSION}"
DISSOLVE_MAJOR=`echo $DISSOLVE_VERSION | sed "s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/g"`
DISSOLVE_MINOR=`echo $DISSOLVE_VERSION | sed "s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/g"`
Expand Down
110 changes: 0 additions & 110 deletions .github/workflows/update-release-info/action.yml

This file was deleted.

10 changes: 3 additions & 7 deletions .github/workflows/website/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ runs:
using: "composite"
steps:

- name: 'Set Version in Main Config'
shell: bash
run: sed -i "s/MAJOR.MINOR/${{ env.dissolveMajorVersion }}.${{ env.dissolveMinorVersion }}/g" web/docs.toml

- name: 'Apply Main Release Styling'
if: ${{ inputs.publishType == 'release' }}
shell: bash
Expand Down Expand Up @@ -126,13 +122,14 @@ runs:
cd ../../
done

- name: 'SSH Deploy to Server (Release) (Docs only)'
- name: 'SSH Deploy to Server (Release) (Full)'
if: ${{ inputs.publishType == 'release' }}
shell: bash
run: |
echo "${SERVER_ID}" > ./serverId
echo "${SERVER_KEY}" > ./serverKey
chmod 0600 ./serverKey ./serverId
rsync -avz --delete -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public/ ${SERVER_IP}:${SERVER_MAIN_DIR}
rsync -avz --delete --exclude=dev --exclude=legacy -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public-docs/ ${SERVER_IP}:${SERVER_DOCS_DIR}

- name: 'SSH Deploy to Server (Legacy) (Docs only)'
Expand All @@ -144,14 +141,13 @@ runs:
chmod 0600 ./serverKey ./serverId
rsync -avz --delete -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public-docs/ ${SERVER_IP}:${SERVER_DOCS_DIR}/legacy

- name: 'SSH Deploy to Server (Continuous)'
- name: 'SSH Deploy to Server (Continuous) (Docs only)'
if: ${{ inputs.publishType == 'continuous' }}
shell: bash
run: |
echo "${SERVER_ID}" > ./serverId
echo "${SERVER_KEY}" > ./serverKey
chmod 0600 ./serverKey ./serverId
rsync -avz --delete -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public/ ${SERVER_IP}:${SERVER_MAIN_DIR}
rsync -avz --delete -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public-docs/ ${SERVER_IP}:${SERVER_DOCS_DIR}/dev

- name: Upload Web Artifacts
Expand Down
Loading
Loading