Skip to content

Commit

Permalink
Merge pull request #265 from CodeForPhilly/develop
Browse files Browse the repository at this point in the history
Release: v3.2.5
  • Loading branch information
themightychris authored Mar 25, 2023
2 parents 8bd1f2b + d490937 commit bf3fa0f
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 343 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/container-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Container: Publish Image'

on:
push:
tags: [ 'v*' ]

permissions:
contents: write
packages: write

jobs:
container-publish:

runs-on: ubuntu-latest
steps:

- uses: EmergencePlatform/php-runtime@github-actions/build-site-container/v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Preview: Deploy'

on:
pull_request:
branches: [ develop ]
types: [ opened, reopened, synchronize ]
push:
branches: [ develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
packages: write

jobs:
preview-deploy:
runs-on: ubuntu-latest
steps:

- uses: EmergencePlatform/php-runtime@github-actions/deploy-site-preview/develop
id: deploy-site-preview
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
kube-config: ${{ secrets.KUBECONFIG_BASE64 }}
kube-namespace: laddr
kube-hostname: laddr.sandbox.k8s.phl.io
90 changes: 0 additions & 90 deletions .github/workflows/release-deploy.yml

This file was deleted.

106 changes: 6 additions & 100 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,111 +4,17 @@ on:
push:
branches: [ develop ]

env:
GITHUB_USERNAME: codeforphilly-bot
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
RELEASE_BRANCH: releases/v3
permissions:
contents: read
pull-requests: write

jobs:
release-prepare:

runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
with:
fetch-depth: 0

# - uses: mxschmitt/action-tmate@v3

- name: Create/update pull request
run: |
# get latest release tag
latest_release=$(git describe --tags --abbrev=0 "origin/${RELEASE_BRANCH}")
latest_release_bumped=$(echo $latest_release | awk -F. -v OFS=. '{$NF++;print}')
# create or update PR
pr_body="$(cat <<EOF
Release: ${latest_release_bumped}
## Improvements
## Technical
EOF
)"
pr_number=$(hub pr list -h develop -f '%I')
if [ -n "${pr_number}" ]; then
echo "Updating PR #${pr_number}"
existing_comment_id=$(hub api "/repos/${GITHUB_REPOSITORY}/issues/${pr_number}/comments" | jq ".[] | select(.user.login==\"${GITHUB_USERNAME}\") | .id")
else
echo "Opening PR"
hub pull-request -b "${RELEASE_BRANCH}" -h develop -F <(echo "${pr_body}") > /tmp/pr.json
pr_number=$(hub pr list -h develop -f '%I')
echo "Opened PR #${pr_number}"
fi
# build changelog
commits=$(
git log \
--first-parent \
--reverse \
--format="%H" \
"origin/${RELEASE_BRANCH}..develop"
)
changelog=()
while read -r commit; do
subject="$(git show -s --format=%s "${commit}")"
line=""
if [[ "${subject}" =~ Merge\ pull\ request\ \#([0-9]+) ]]; then
line="$(hub pr show -f '%t [%i] @%au' "${BASH_REMATCH[1]}" || true)"
fi
if [ -z "${line}" ]; then
author="$(hub api "/repos/${GITHUB_REPOSITORY}/commits/${commit}" -H Accept:application/vnd.github.v3+json | jq -r '.author.login')"
if [ -n "${author}" ]; then
author="@${author}"
else
author="$(git show -s --format=%ae "${commit}")"
fi
line="${subject} ${author}"
fi
# move ticket number prefix into to existing square brackets at end
line="$(echo "${line}" | perl -pe 's/^([A-Z]+-[0-9]+):?\s*(.*?)\s*\[([^]]+)\]\s*(\S+)$/\2 [\3, \1] \4/')"
# move ticket number prefix into to new square brackets at end
line="$(echo "${line}" | perl -pe 's/^([A-Z]+-[0-9]+):?\s*(.*?)\s*(\S+)$/\2 [\1] \3/')"
# combine doubled square brackets at the end
line="$(echo "${line}" | perl -pe 's/^\s*(.*?)\s*\[([A-Z]+-[0-9]+)\]\s*\[([^]]+)\]\s*(\S+)$/\1 [\3, \2] \4/')"
changelog+=("- ${line}")
done <<< "${commits}"
# create or update comment
comment_body="$(cat <<EOF
## Changelog
\`\`\`markdown
$(IFS=$'\n'; echo "${changelog[*]}")
\`\`\`
EOF
)"
if [ -n "${existing_comment_id}" ]; then
echo "Updating comment #${existing_comment_id}"
hub api "/repos/${GITHUB_REPOSITORY}/issues/comments/${existing_comment_id}" -f body="${comment_body}"
else
echo "Creating comment"
hub api "/repos/${GITHUB_REPOSITORY}/issues/${pr_number}/comments" -f body="${comment_body}"
fi
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: releases/v3
16 changes: 16 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Release: Publish PR'

on:
pull_request:
branches: [ releases/v3 ]
types: [ closed ]

jobs:
release-publish:

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
24 changes: 3 additions & 21 deletions .github/workflows/release-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,12 @@ on:
branches: [ 'releases/v*' ]
types: [ opened, edited, reopened, synchronize ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
release-validate:

runs-on: ubuntu-latest
steps:

- name: Validate PR title
run: |
PR_TITLE=$(jq -r ".pull_request.title" $GITHUB_EVENT_PATH)
# check title format and extract tag
if [[ "${PR_TITLE}" =~ ^Release:\ v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then
RELEASE_TAG="${PR_TITLE:9}"
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
else
echo 'PR title must match format "Release: vX.Y.Z(-rc.#)?"'
exit 1
fi
# check that tag doesn't exist
if git ls-remote --exit-code "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}" "refs/tags/${RELEASE_TAG}"; then
echo "The PR title's version exists already"
exit 1
fi
- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .holo/branches/docs-site/_laddr.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[holomapping]
root = "docs"
files = [
"docs/**",
"mkdocs.*.yml"
]
6 changes: 6 additions & 0 deletions .holo/branches/docs-site/docs/_laddr.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[holomapping]
root = "docs"
files = [
"**",
"!mkdocs.*.yml",
]
2 changes: 1 addition & 1 deletion .holo/sources/skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[holosource]
url = "https://github.com/JarvusInnovations/emergence-skeleton-v2"
ref = "refs/tags/v2.11.2"
ref = "refs/tags/v2.12.4"
28 changes: 0 additions & 28 deletions .studiorc

This file was deleted.

Loading

0 comments on commit bf3fa0f

Please sign in to comment.