Skip to content

Commit

Permalink
Merge pull request #231 from CodeForPhilly/develop
Browse files Browse the repository at this point in the history
Release: v3.0.0
  • Loading branch information
themightychris committed Aug 25, 2021
2 parents 4539afc + 181d2ac commit 79f30e1
Show file tree
Hide file tree
Showing 18 changed files with 423 additions and 18 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Docs

on:
push:
branches: [ develop ]

jobs:

publish-docs:
runs-on: ubuntu-latest
steps:

- name: 'Update holobranch: gh-pages'
uses: JarvusInnovations/hologit@actions/projector/v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HAB_LICENSE: accept
with:
holobranch: docs-site
commit-to: gh-pages
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Projections
name: Publish Holobranches

on:
push:
tags:
- 'v3.*'

tags: [ 'v3.*' ]

jobs:
holobranch-projections:

publish-holobranches:
runs-on: ubuntu-latest
steps:

- name: 'Update holobranch: emergence/skeleton/v3'
uses: JarvusInnovations/hologit@actions/projector/v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HAB_LICENSE: accept
with:
ref: releases/v3
holobranch: emergence-skeleton
commit-to: emergence/skeleton/v3

- name: 'Update holobranch: emergence/vfs-site/v3'
uses: JarvusInnovations/hologit@actions/projector/v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HAB_LICENSE: accept
with:
ref: releases/v3
holobranch: emergence-vfs-site
commit-to: emergence/vfs-site/v3

- name: 'Update v3.laddr.us'
env:
VFS_DEV_TOKEN: ${{ secrets.VFS_DEV_TOKEN }}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Release: Deploy PR'

on:
pull_request:
branches: [ 'releases/v*' ]
types: [ closed ]

jobs:
release-deploy:

if: github.event.pull_request.merged == true # only run on PR merge
runs-on: ubuntu-latest
steps:

- name: Configure release
run: |
PR_TITLE=$(jq -r ".pull_request.title" $GITHUB_EVENT_PATH)
PR_BODY=$(jq -r ".pull_request.body" $GITHUB_EVENT_PATH)
RELEASE_TAG=$(echo "${PR_TITLE}" | grep -oP "(?<=^Release: )v\d+\.\d+\.\d+(-rc\.\d+)?$")
if [[ "${RELEASE_TAG}" =~ -rc\.[0-9]+$ ]]; then
RELEASE_PRERELEASE=true
else
RELEASE_PRERELEASE=false
fi
echo "PR_TITLE=${PR_TITLE}" >> $GITHUB_ENV
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
echo "RELEASE_PRERELEASE=${RELEASE_PRERELEASE}" >> $GITHUB_ENV
echo 'PR_BODY<<END_OF_PR_BODY' >> $GITHUB_ENV
echo "${PR_BODY}" >> $GITHUB_ENV
echo 'END_OF_PR_BODY' >> $GITHUB_ENV
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
commit: '${{ github.sha }}'
tag: '${{ env.RELEASE_TAG }}'
body: '${{ env.PR_BODY }}'
draft: false
prerelease: ${{ env.RELEASE_PRERELEASE }}
113 changes: 113 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: 'Release: Prepare PR'

on:
push:
branches: [ develop ]

env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
RELEASE_BRANCH: releases/v3

jobs:
release-prepare:

runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
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=="jarvus-bot") | .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
34 changes: 34 additions & 0 deletions .github/workflows/release-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Release: Validate PR'

on:
pull_request:
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
5 changes: 5 additions & 0 deletions .holo/branches/docs-site/_laddr.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[holomapping]
files = [
"docs/**",
"mkdocs.*.yml"
]
4 changes: 4 additions & 0 deletions .holo/branches/docs-site/_skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[holomapping]
holosource="=>docs-skeleton"
files = "**"
before = "*"
11 changes: 10 additions & 1 deletion .holo/branches/emergence-site/_laddr.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
[holomapping]
files = [
"*/**",

# exclude CI and developer assets
"!.github/",
"!.vscode/",
"!docs/"
"!cypress/",
"!docs/",
"!fixtures/",
"!habitat/",
"!helm-chart/",
"!php-config/Git.config.d/",
"!script/",
]
after = "*"
6 changes: 2 additions & 4 deletions .holo/branches/emergence-site/_skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[holomapping]
files = [
"*/**",
"!php-config/Git.config.d/"
]
holosource="=>emergence-skeleton"
files = "**"
before = "*"
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/heads/emergence/skeleton/v2"
ref = "refs/tags/v2.6.12"
19 changes: 18 additions & 1 deletion .studiorc
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#!/bin/bash
hab pkg install emergence/studio

# install dependent studios
hab pkg install emergence/studio jarvus/mkdocs-studio

# disable studios printing their own help
export STUDIO_NOHELP="yes"

source "$(hab pkg path emergence/studio)/studio.sh"

export DOCS_HOLOBRANCH="docs-site"
source "$(hab pkg path jarvus/mkdocs-studio)/studio.sh"


## final init and output
studio-help


# final blank line
echo
File renamed without changes.
4 changes: 2 additions & 2 deletions html-templates/confirm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</div>
<p class="confirm">{$question}</p>
<form method="POST">
<button type="button" class="btn btn-secondary margin-right" name="Sure" value="No" onclick="javascript:history.go(-1);">{_ No}</button>
<button type="submit" class="btn btn-danger" name="Sure">{_ Yes}</button>
<button type="button" class="btn btn-secondary margin-right" name="Sure" value="No" onclick="javascript:history.go(-1);">{_ 'No'}</button>
<button type="submit" class="btn btn-danger" name="Sure">{_ 'Yes'}</button>
</form>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion html-templates/project-updates/projectUpdates.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{block content}
<header class="page-header">
<h2>
{capture assign=projectTitleLink}<a href="{$Project->getURL()}">{$Project->Title|escape}</a>{/capture}
{if $Project}
{capture assign=projectTitleLink}<a href="{$Project->getURL()}">{$Project->Title|escape}</a>{/capture}
{sprintf(_("Project Updates in %s"), $projectTitleLink)}
{else}
{_ "Project Updates"}
Expand Down
4 changes: 4 additions & 0 deletions mkdocs.site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
site_name: laddr documentation
repo_url: https://github.com/CodeForPhilly/laddr
site_url: https://codeforphilly.github.io/laddr
edit_uri: edit/develop/docs
2 changes: 1 addition & 1 deletion php-classes/Emergence/Meetup/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function getUpcomingEvents()
throw new Exception('meetup feed unavailable');
} elseif (false === $events) {
$cal = new IcalParser();
$cal->parseFile("https://www.meetup.com/{$groupSlug}/events/ical/");
@$cal->parseFile("https://www.meetup.com/{$groupSlug}/events/ical/");

$events = [];
foreach ($cal->getSortedEvents() as $event) {
Expand Down

0 comments on commit 79f30e1

Please sign in to comment.