Skip to content

Commit

Permalink
Fix build by switching to GitHub actions (#358)
Browse files Browse the repository at this point in the history
* Remove old build.

* Setup repository for draft-ietf-mls-protocol using https://github.com/martinthomson/i-d-template

* Revert unnecessary changes.
  • Loading branch information
Brendan McMillion authored Jul 11, 2020
1 parent fd9222c commit 3a6ac80
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 107 deletions.
93 changes: 63 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,90 @@ jobs:
working_directory: ~/draft

steps:
- checkout
- run:
name: "Print Configuration"
command: |
xml2rfc --version
gem list -q kramdown-rfc2629
echo -n 'mmark '; mmark --version
# Prime caches for faster checkout
- restore_cache:
name: "Restoring cache - Git"
keys:
- template
- run:
name: "Update Template"
command: "git -C ~/i-d-template remote update --prune"
- save_cache:
key: template
paths:
- ~/i-d-template
- v2-cache-git-{{ .Branch }}-{{ .Revision }}
- v2-cache-git-{{ .Branch }}
- v2-cache-git-

# Build txt and html versions of drafts
- restore_cache:
name: "Restoring cache - References"
keys:
- refcache
- run:
name: "Build Drafts"
command: "make 'CLONE_ARGS=--reference ~/i-d-template'"
- save_cache:
key: refcache
paths:
- ~/.cache/xml2rfc
- v1-cache-references-{{ epoch }}
- v1-cache-references-

# Create and store artifacts
# Workaround for https://discuss.circleci.com/t/22437
- run:
name: "Create Artifacts"
command: "make artifacts CI_ARTIFACTS=/tmp/artifacts"
name: Tag Checkout
command: |
if [ -n "$CIRCLE_TAG" ] && [ -d .git ]; then
remote=$(echo "$CIRCLE_REPOSITORY_URL" | \
sed -e 's,/^git.github.com:,https://github.com/,')
git fetch -f "$remote" "refs/tags/$CIRCLE_TAG:refs/tags/$CIRCLE_TAG" || \
(echo 'Removing .git cache for tag build'; rm -rf .git)
fi
- store_artifacts:
path: /tmp/artifacts
- checkout

# Update gh-pages and gh-issues branches
# Build txt and html versions of drafts
- run:
name: "Update GitHub Pages"
command: "make gh-pages"
name: "Build Drafts"
command: "make 'CLONE_ARGS=--reference ~/git-reference'"

# Update editor's copy on gh-pages
- run:
name: "Save Issues"
command: "make gh-issues || true"
name: "Update GitHub Pages"
command: |
if [ "${CIRCLE_TAG#draft-}" == "$CIRCLE_TAG" ]; then
make gh-pages
fi
# For tagged builds, upload to the datatracker.
- deploy:
name: "Upload to Datatracker"
command: |
if [ "${CIRCLE_TAG#draft-}" != "${CIRCLE_TAG}" ]; then
if [ "${CIRCLE_TAG#draft-}" != "$CIRCLE_TAG" ]; then
make upload
fi
# Archive GitHub Issues
- run:
name: "Archive GitHub Issues"
command: "make archive || make archive DISABLE_ARCHIVE_FETCH=true && make gh-archive"

# Create and store artifacts
- run:
name: "Create Artifacts"
command: "make artifacts CI_ARTIFACTS=/tmp/artifacts"

- store_artifacts:
path: /tmp/artifacts

- run:
name: "Prepare for Caching"
command: "git reflog expire --expire=now --all && git gc --prune=now"

- save_cache:
name: "Saving Cache - Git"
key: v2-cache-git-{{ .Branch }}-{{ .Revision }}
paths:
- ~/draft/.git

- save_cache:
name: "Saving Cache - Drafts"
key: v1-cache-references-{{ epoch }}
paths:
- ~/.cache/xml2rfc


workflows:
version: 2
build:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Archive Issues and Pull Requests"

on:
schedule:
- cron: '0 0 * * 0,2,4'
repository_dispatch:
types: [archive]

jobs:
build:
name: "Archive Issues and Pull Requests"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2

- name: "Update Archive"
uses: martinthomson/i-d-template@v1
with:
make: archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Update GitHub Pages"
uses: martinthomson/i-d-template@v1
with:
make: gh-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Save Archive"
uses: actions/upload-artifact@v2
with:
path: archive.json
60 changes: 60 additions & 0 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Update Editor's Copy"

on:
push:
paths-ignore:
- README.md
- CONTRIBUTING.md
- LICENSE.md
- .gitignore
pull_request:
paths-ignore:
- README.md
- CONTRIBUTING.md
- LICENSE.md
- .gitignore

jobs:
build:
name: "Update Editor's Copy"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2

- name: "Cache Setup"
id: cache-setup
run: |
mkdir -p "$HOME"/.cache/xml2rfc
echo "::set-output name=path::$HOME/.cache/xml2rfc"
date -u "+::set-output name=date::%FT%T"
- name: "Cache References"
uses: actions/cache@v2
with:
path: ${{ steps.cache-setup.outputs.path }}
key: refcache-${{ steps.cache-setup.outputs.date }}
restore-keys: |
refcache-${{ steps.cache-setup.outputs.date }}
refcache-
- name: "Build Drafts"
uses: martinthomson/i-d-template@v1

- name: "Update GitHub Pages"
uses: martinthomson/i-d-template@v1
if: ${{ github.event_name == 'push' }}
with:
make: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Save HTML"
uses: actions/upload-artifact@v2
with:
path: "*.html"

- name: "Save Text"
uses: actions/upload-artifact@v2
with:
path: "*.txt"
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Publish New Draft Version"

on:
push:
tags:
- "draft-*"

jobs:
build:
name: "Publish New Draft Version"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2

# See https://github.com/actions/checkout/issues/290
- name: "Get Tag Annotations"
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}

- name: "Cache Setup"
id: cache-setup
run: |
mkdir -p "$HOME"/.cache/xml2rfc
echo "::set-output name=path::$HOME/.cache/xml2rfc"
date -u "+::set-output name=date::%FT%T"
- name: "Cache References"
uses: actions/cache@v2
with:
path: ${{ steps.cache-setup.outputs.path }}
key: refcache-${{ steps.date.outputs.date }}
restore-keys: |
refcache-${{ steps.date.outputs.date }}
refcache-
- name: "Upload to Datatracker"
uses: martinthomson/i-d-template@v1
with:
make: upload
17 changes: 10 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
.#*
*#
*.redxml
*.txt
*.html
*.pdf
*.redxml
*.swp
*.txt
*.upload
.tags
*~
*.swp
/*-[0-9][0-9].xml
.#*
.refcache
.tags
.targets.mk
venv/
/*-[0-9][0-9].xml
archive.json
draft-ietf-mls-protocol.xml
issues.json
lib
pulls.json
report.xml
venv/
lib
draft-ietf-mls-protocol.xml
4 changes: 4 additions & 0 deletions .note.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<note title="Discussion Venues" removeInRFC="true">
<t>Source for this draft and an issue tracker can be found at
<eref target="https://github.com/mlswg/mls-protocol">https://github.com/mlswg/mls-protocol</eref>.</t>
</note>
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subject to a Simplified BSD License) in Contributions.
Discussion of this work occurs on the
[mls working group mailing list](https://mailarchive.ietf.org/arch/browse/mls/)
([subscribe](https://www.ietf.org/mailman/listinfo/mls)). In addition to
contributions in github, you are encouraged to participate in discussions there.
contributions in GitHub, you are encouraged to participate in discussions there.

**Note**: Some working groups adopt a policy whereby substantive discussion of
technical issues needs to occur on the mailing list.
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ LIBDIR := lib
include $(LIBDIR)/main.mk

$(LIBDIR)/main.mk:
ifneq (,$(shell git submodule status $(LIBDIR) 2>/dev/null))
ifneq (,$(shell grep "path *= *$(LIBDIR)" .gitmodules 2>/dev/null))
git submodule sync
git submodule update $(CLONE_ARGS) --init
else
git clone -q --depth 10 $(CLONE_ARGS) \
-b master https://github.com/martinthomson/i-d-template $(LIBDIR)
-b main https://github.com/martinthomson/i-d-template $(LIBDIR)
endif

cleanup-netlify-cache:
rm -rf ~/.bundle

fix-insecure-links:
sed -i'.bak' -e 's/http:/https:/g' draft-ietf-mls-protocol.html
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#
# The Messaging Layer Security (MLS) Protocol

This is the working area for the IETF MLS Working Group Internet-Draft, "The Messaging Layer Security (MLS) Protocol".
This is the working area for the IETF [MLS Working Group](https://datatracker.ietf.org/wg/mls/documents/) Internet-Draft, "The Messaging Layer Security (MLS) Protocol".

* [Editor's Copy](https://github.com/mlswg/mls-protocol/blob/master/draft-ietf-mls-protocol.md)
* [Editor's Copy](https://mlswg.github.io/mls-protocol/#go.draft-ietf-mls-protocol.html)
* [Working Group Draft](https://tools.ietf.org/html/draft-ietf-mls-protocol)
* [Compare Editor's Copy to Working Group Draft](https://github.com/mlswg/mls-protocol/compare/draft-ietf-mls-protocol-00...master)

[![Build Status](https://travis-ci.org/mlswg/mls-protocol.svg?branch=master)](https://travis-ci.org/mlswg/mls-protocol)
* [Compare Editor's Copy to Working Group Draft](https://mlswg.github.io/mls-protocol/#go.draft-ietf-mls-protocol.diff)

## Building the Draft

Expand Down
8 changes: 0 additions & 8 deletions build-configuration/Gemfile

This file was deleted.

18 changes: 0 additions & 18 deletions build-configuration/Gemfile.lock

This file was deleted.

1 change: 0 additions & 1 deletion build-configuration/requirements.txt

This file was deleted.

0 comments on commit 3a6ac80

Please sign in to comment.