Skip to content

Commit 7cb94f5

Browse files
committed
Build and publish appcasts with GitHub Pages
1 parent c2482d6 commit 7cb94f5

File tree

8 files changed

+235
-0
lines changed

8 files changed

+235
-0
lines changed

.github/workflows/appcast.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and publish a new appcast file
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
7+
jobs:
8+
jekyll:
9+
runs-on: ubuntu-16.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- uses: actions/cache@v2
14+
with:
15+
path: vendor/bundle
16+
key: ${{ runner.os }}-gems-v1.0-${{ hashFiles('AppCast/Gemfile') }}
17+
restore-keys: |
18+
${{ runner.os }}-gems-
19+
20+
- uses: helaili/jekyll-action@v2
21+
env:
22+
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
gem_src: 'AppCast'
26+
jekyll_src: 'AppCast'
27+
target_branch: 'gh-pages'

AppCast/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_site
2+
.sass-cache
3+
.jekyll-metadata

AppCast/Gemfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
source "https://rubygems.org"
2+
3+
# Hello! This is where you manage which Jekyll version is used to run.
4+
# When you want to use a different version, change it below, save the
5+
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
6+
#
7+
# bundle exec jekyll serve
8+
#
9+
# This will help ensure the proper Jekyll version is running.
10+
# Happy Jekylling!
11+
gem "jekyll", "~> 3.9.0"
12+
13+
gem "jekyll-github-metadata", group: :jekyll_plugins
14+
15+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
16+
# and associated library.
17+
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
18+
gem "tzinfo", "~> 1.2"
19+
gem "tzinfo-data"
20+
end
21+
22+
# Performance-booster for watching directories on Windows
23+
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
24+
25+
# kramdown v2 ships without the gfm parser by default. If you're using
26+
# kramdown v1, comment out this line.
27+
gem "kramdown-parser-gfm"
28+

AppCast/Gemfile.lock

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.7.0)
5+
public_suffix (>= 2.0.2, < 5.0)
6+
colorator (1.1.0)
7+
concurrent-ruby (1.1.7)
8+
em-websocket (0.5.2)
9+
eventmachine (>= 0.12.9)
10+
http_parser.rb (~> 0.6.0)
11+
eventmachine (1.2.7)
12+
faraday (1.3.0)
13+
faraday-net_http (~> 1.0)
14+
multipart-post (>= 1.2, < 3)
15+
ruby2_keywords
16+
faraday-net_http (1.0.1)
17+
ffi (1.14.2)
18+
forwardable-extended (2.6.0)
19+
http_parser.rb (0.6.0)
20+
i18n (0.9.5)
21+
concurrent-ruby (~> 1.0)
22+
jekyll (3.9.0)
23+
addressable (~> 2.4)
24+
colorator (~> 1.0)
25+
em-websocket (~> 0.5)
26+
i18n (~> 0.7)
27+
jekyll-sass-converter (~> 1.0)
28+
jekyll-watch (~> 2.0)
29+
kramdown (>= 1.17, < 3)
30+
liquid (~> 4.0)
31+
mercenary (~> 0.3.3)
32+
pathutil (~> 0.9)
33+
rouge (>= 1.7, < 4)
34+
safe_yaml (~> 1.0)
35+
jekyll-github-metadata (2.13.0)
36+
jekyll (>= 3.4, < 5.0)
37+
octokit (~> 4.0, != 4.4.0)
38+
jekyll-sass-converter (1.5.2)
39+
sass (~> 3.4)
40+
jekyll-watch (2.2.1)
41+
listen (~> 3.0)
42+
kramdown (2.3.0)
43+
rexml
44+
kramdown-parser-gfm (1.1.0)
45+
kramdown (~> 2.0)
46+
liquid (4.0.3)
47+
listen (3.4.1)
48+
rb-fsevent (~> 0.10, >= 0.10.3)
49+
rb-inotify (~> 0.9, >= 0.9.10)
50+
mercenary (0.3.6)
51+
multipart-post (2.1.1)
52+
octokit (4.20.0)
53+
faraday (>= 0.9)
54+
sawyer (~> 0.8.0, >= 0.5.3)
55+
pathutil (0.16.2)
56+
forwardable-extended (~> 2.6)
57+
public_suffix (4.0.6)
58+
rb-fsevent (0.10.4)
59+
rb-inotify (0.10.1)
60+
ffi (~> 1.0)
61+
rexml (3.2.4)
62+
rouge (3.26.0)
63+
ruby2_keywords (0.0.2)
64+
safe_yaml (1.0.5)
65+
sass (3.7.4)
66+
sass-listen (~> 4.0.0)
67+
sass-listen (4.0.0)
68+
rb-fsevent (~> 0.9, >= 0.9.4)
69+
rb-inotify (~> 0.9, >= 0.9.7)
70+
sawyer (0.8.2)
71+
addressable (>= 2.3.5)
72+
faraday (> 0.8, < 2.0)
73+
thread_safe (0.3.6)
74+
tzinfo (1.2.9)
75+
thread_safe (~> 0.1)
76+
tzinfo-data (1.2020.6)
77+
tzinfo (>= 1.0.0)
78+
wdm (0.1.1)
79+
80+
PLATFORMS
81+
x86_64-darwin-20
82+
83+
DEPENDENCIES
84+
jekyll (~> 3.9.0)
85+
jekyll-github-metadata
86+
kramdown-parser-gfm
87+
tzinfo (~> 1.2)
88+
tzinfo-data
89+
wdm (~> 0.1.0)
90+
91+
BUNDLED WITH
92+
2.2.5

AppCast/_config.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Welcome to Jekyll!
2+
#
3+
# This config file is meant for settings that affect your whole blog, values
4+
# which you are expected to set up once and rarely edit after that. If you find
5+
# yourself editing this file very often, consider using Jekyll's data files
6+
# feature for the data you need to update frequently.
7+
#
8+
# For technical reasons, this file is *NOT* reloaded automatically when you use
9+
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
10+
11+
# Site settings
12+
# These are used to personalize your new site. If you look in the HTML files,
13+
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
14+
# You can create any custom variable you would like, and they will be accessible
15+
# in the templates via {{ site.myvariable }}.
16+
title: Xcodes.app
17+
description: >- # this means to ignore newlines until "baseurl:"
18+
baseurl: "" # the subpath of your site, e.g. /blog
19+
url: "" # the base hostname & protocol for your site, e.g. http://example.com
20+
21+
# Build settings
22+
markdown: kramdown
23+
plugins:
24+
- "jekyll-github-metadata"
25+
26+
# Exclude from processing.
27+
# The following items will not be processed, by default. Create a custom list
28+
# to override the default setting.
29+
# exclude:
30+
# - Gemfile
31+
# - Gemfile.lock
32+
# - node_modules
33+
# - vendor/bundle/
34+
# - vendor/cache/
35+
# - vendor/gems/
36+
# - vendor/ruby/

AppCast/_includes/appcast.inc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
3+
<channel>
4+
<title>{{ site.github.project_title }}</title>
5+
<description>Most recent changes with links to updates.</description>
6+
<language>en</language>
7+
{% for release in site.github.releases %}
8+
{% unless release.draft %}
9+
{% unless release.prerelease and page.release_only %}
10+
<item>
11+
<title>{{ release.name }}</title>
12+
<description><![CDATA[{{ release.body | markdownify }}]]></description>
13+
<pubDate>{{ release.published_at | date_to_rfc822 }}</pubDate>
14+
{% for asset in release.assets limit:1 %}
15+
{% assign build_nums = release.tag_name | replace_first:'v','' | replace_first:'b',',' | split:',' %}
16+
{% if build_nums.size == 2 %}
17+
{% assign version_number = build_nums[0] %}
18+
{% assign build_number = build_nums[1] %}
19+
20+
<enclosure
21+
url="{{ asset.browser_download_url }}"
22+
sparkle:version="{{ build_number }}"
23+
sparkle:shortVersionString="{{ version_number }}"
24+
length="{{ asset.size }}"
25+
type="application/octet-stream" />
26+
{% else %}
27+
{% assign version = release.tag_name | remove_first:'v' %}
28+
29+
<enclosure
30+
url="{{ asset.browser_download_url }}"
31+
sparkle:version="{{ version }}"
32+
length="{{ asset.size }}"
33+
type="application/octet-stream" />
34+
{% endif %}
35+
{% endfor %}
36+
</item>
37+
{% endunless %}
38+
{% endunless %}
39+
{% endfor %}
40+
</channel>
41+
</rss>

AppCast/appcast.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
release_only: true
3+
---
4+
{%include appcast.inc %}

AppCast/appcast_pre.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
release_only: false
3+
---
4+
{%include appcast.inc %}

0 commit comments

Comments
 (0)