add release process
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name-template: 'v$RESOLVED_VERSION'
|
||||||
|
tag-template: 'v$RESOLVED_VERSION'
|
||||||
|
template: |
|
||||||
|
# Changelog
|
||||||
|
$CHANGES
|
||||||
|
See details of [all code changes](https://github.com/actions/jekyll-build-pages/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
|
||||||
|
categories:
|
||||||
|
- title: '🚀 Features'
|
||||||
|
labels:
|
||||||
|
- 'feature'
|
||||||
|
- 'enhancement'
|
||||||
|
- title: '🐛 Bug Fixes'
|
||||||
|
labels:
|
||||||
|
- 'fix'
|
||||||
|
- 'bugfix'
|
||||||
|
- 'bug'
|
||||||
|
- title: '🧰 Maintenance'
|
||||||
|
labels:
|
||||||
|
- 'infrastructure'
|
||||||
|
- 'automation'
|
||||||
|
- 'documentation'
|
||||||
|
- title: '🏎 Performance'
|
||||||
|
label: 'performance'
|
||||||
|
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||||
|
version-resolver:
|
||||||
|
major:
|
||||||
|
labels:
|
||||||
|
- 'type: breaking'
|
||||||
|
minor:
|
||||||
|
labels:
|
||||||
|
- 'type: enhancement'
|
||||||
|
patch:
|
||||||
|
labels:
|
||||||
|
- 'type: bug'
|
||||||
|
- 'type: maintenance'
|
||||||
|
- 'type: documentation'
|
||||||
|
default: patch
|
||||||
@@ -9,20 +9,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
paths-ignore:
|
- 'feature-*'
|
||||||
- 'README.md'
|
|
||||||
# Publish semver tags as releases. Allow for '-alpha'
|
|
||||||
# stage releases as well.
|
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*-beta'
|
|
||||||
- 'v*.*.*-alpha'
|
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
paths-ignore:
|
|
||||||
- 'README.md'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Use docker.io for Docker Hub if empty
|
# Use docker.io for Docker Hub if empty
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
@@ -40,15 +29,21 @@ jobs:
|
|||||||
# Login against a Docker registry except on PR
|
# Login against a Docker registry except on PR
|
||||||
# https://github.com/docker/login-action
|
# https://github.com/docker/login-action
|
||||||
- name: Log into registry ${{ env.REGISTRY }}
|
- name: Log into registry ${{ env.REGISTRY }}
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Generate Image Tags
|
||||||
# Extract metadata (tags, labels) for Docker
|
id: generate-image-tags
|
||||||
# https://github.com/docker/metadata-action
|
run: |
|
||||||
|
# Generate tags for the image
|
||||||
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||||
|
tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
|
else
|
||||||
|
tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
|
||||||
|
fi
|
||||||
|
echo "::set-output name=tags::$tags"
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@v3
|
||||||
@@ -62,24 +57,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.generate-image-tags.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
# Drafts your next Release notes as Pull Requests are merged into "main"
|
||||||
- name: Render Action Metadata
|
- uses: release-drafter/release-drafter@v5
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: github.ref_name == 'main'
|
||||||
run: |
|
env:
|
||||||
./bin/render_action_metadata "docker://ghcr.io/actions/jekyll-build-pages:${{ github.ref_name }}" > action.yml
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
git add action.yml
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git commit -m "Add generated action.yml 🤖"
|
|
||||||
if [[ '${{ github.ref_type }}' == 'tag' ]]; then
|
|
||||||
echo "Pushing tag ${{ github.ref_name }}"
|
|
||||||
git tag -f ${{ github.ref_name }}
|
|
||||||
git push -f origin ${{ github.ref_name }}
|
|
||||||
else
|
|
||||||
echo "Pushing branch ${{ github.ref_name }}"
|
|
||||||
git push origin ${{ github.ref_name }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
name: Release new action version
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [edited]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
TAG_NAME:
|
||||||
|
description: 'Tag name that the major tag will point to'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify_release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Grep action.yaml content
|
||||||
|
id: grep-image-content
|
||||||
|
run: |
|
||||||
|
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
|
||||||
|
echo "::set-output name=image::$image"
|
||||||
|
- uses: actions-ecosystem/action-regex-match@v2
|
||||||
|
id: regex-match
|
||||||
|
with:
|
||||||
|
text: ${{ steps.grep-image-content.outputs.image }}
|
||||||
|
regex: "jekyll-build-pages:(.*)'"
|
||||||
|
- name: Version match
|
||||||
|
run: |
|
||||||
|
if [ "${{ steps.regex-match.outputs.group1 }}" != "${{ env.TAG_NAME }}" ]; then
|
||||||
|
echo "version mismatch. action.yaml with version ${{ steps.regex-match.outputs.group1 }} Tag version ${{ env.TAG_NAME }}";
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- name: Verify image published
|
||||||
|
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }}
|
||||||
|
update_tag:
|
||||||
|
needs: verify_release
|
||||||
|
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
||||||
|
environment:
|
||||||
|
name: releaseNewActionVersion
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
major_tag: ${{ steps.update-major-tag.outputs.major-tag }}
|
||||||
|
steps:
|
||||||
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
|
id: update-major-tag
|
||||||
|
uses: actions/[email protected]
|
||||||
|
with:
|
||||||
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
+65
-30
@@ -9,20 +9,45 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
env:
|
||||||
|
# Use docker.io for Docker Hub if empty
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
# github.repository as <account>/<repo>
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
resolve-image-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: grep action.yaml content
|
||||||
|
id: grep-image-content
|
||||||
|
run: |
|
||||||
|
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
|
||||||
|
echo "::set-output name=image::$image"
|
||||||
|
- uses: actions-ecosystem/action-regex-match@v2
|
||||||
|
id: regex-match
|
||||||
|
with:
|
||||||
|
text: ${{ steps.grep-image-content.outputs.image }}
|
||||||
|
regex: "jekyll-build-pages:(.*)'"
|
||||||
|
|
||||||
test-simple:
|
test-simple:
|
||||||
|
needs: resolve-image-tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TEST_NAME: simple
|
TEST_NAME: simple
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Build local docker image
|
||||||
- name: Render Action Metadata
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
./bin/render_action_metadata Dockerfile > action.yml
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||||
- name: Test ${{ env.TEST_NAME }} Project
|
- name: Test ${{ env.TEST_NAME }} Project
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -37,17 +62,19 @@ jobs:
|
|||||||
path: ./test_projects/${{ env.TEST_NAME }}
|
path: ./test_projects/${{ env.TEST_NAME }}
|
||||||
|
|
||||||
test-readme:
|
test-readme:
|
||||||
|
needs: resolve-image-tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TEST_NAME: readme
|
TEST_NAME: readme
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Build local docker image
|
||||||
- name: Render Action Metadata
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
./bin/render_action_metadata Dockerfile > action.yml
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||||
- name: Test ${{ env.TEST_NAME }} Project
|
- name: Test ${{ env.TEST_NAME }} Project
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -62,17 +89,19 @@ jobs:
|
|||||||
path: ./test_projects/${{ env.TEST_NAME }}
|
path: ./test_projects/${{ env.TEST_NAME }}
|
||||||
|
|
||||||
test-octicons:
|
test-octicons:
|
||||||
|
needs: resolve-image-tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TEST_NAME: octicons
|
TEST_NAME: octicons
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Build local docker image
|
||||||
- name: Render Action Metadata
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
./bin/render_action_metadata Dockerfile > action.yml
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||||
- name: Test ${{ env.TEST_NAME }} Project
|
- name: Test ${{ env.TEST_NAME }} Project
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -87,17 +116,19 @@ jobs:
|
|||||||
path: ./test_projects/${{ env.TEST_NAME }}
|
path: ./test_projects/${{ env.TEST_NAME }}
|
||||||
|
|
||||||
test-mojombo:
|
test-mojombo:
|
||||||
|
needs: resolve-image-tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TEST_NAME: mojombo
|
TEST_NAME: mojombo
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Build local docker image
|
||||||
- name: Render Action Metadata
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
./bin/render_action_metadata Dockerfile > action.yml
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||||
- name: Test ${{ env.TEST_NAME }} Project
|
- name: Test ${{ env.TEST_NAME }} Project
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -112,17 +143,19 @@ jobs:
|
|||||||
path: ./test_projects/${{ env.TEST_NAME }}
|
path: ./test_projects/${{ env.TEST_NAME }}
|
||||||
|
|
||||||
test-themes:
|
test-themes:
|
||||||
|
needs: resolve-image-tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TEST_NAME: themes
|
TEST_NAME: themes
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Build local docker image
|
||||||
- name: Render Action Metadata
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
./bin/render_action_metadata Dockerfile > action.yml
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||||
- name: Test ${{ env.TEST_NAME }} Project
|
- name: Test ${{ env.TEST_NAME }} Project
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -137,17 +170,19 @@ jobs:
|
|||||||
path: ./test_projects/${{ env.TEST_NAME }}
|
path: ./test_projects/${{ env.TEST_NAME }}
|
||||||
|
|
||||||
test-jekyll-include-cache:
|
test-jekyll-include-cache:
|
||||||
|
needs: resolve-image-tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TEST_NAME: jekyll-include-cache
|
TEST_NAME: jekyll-include-cache
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Build local docker image
|
||||||
- name: Render Action Metadata
|
uses: docker/build-push-action@v2
|
||||||
run: |
|
with:
|
||||||
./bin/render_action_metadata Dockerfile > action.yml
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
tags: ${{ needs.resolve-image-tag.outputs.tag }}
|
||||||
- name: Test ${{ env.TEST_NAME }} Project
|
- name: Test ${{ env.TEST_NAME }} Project
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
# Generated from action.yml.erb
|
|
||||||
# <%= nonce %>
|
|
||||||
name: 'Pages Jekyll'
|
|
||||||
description: 'A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages'
|
|
||||||
inputs:
|
|
||||||
source:
|
|
||||||
description: 'Directory where the source files reside.'
|
|
||||||
required: false
|
|
||||||
default: ./
|
|
||||||
destination:
|
|
||||||
description: 'Output directory of the build. Although it can be nested inside the source, it cannot be the same as the source directory.'
|
|
||||||
required: false
|
|
||||||
default: ./_site
|
|
||||||
future:
|
|
||||||
description: 'Publishes posts with a future date. When set to true, the build is made with the --future option which overrides the future option that may be set in a Jekyll configuration file.'
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
build_revision:
|
|
||||||
description: 'The SHA-1 of the git commit for which the build is running. Default to GITHUB_SHA.'
|
|
||||||
required: false
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
verbose:
|
|
||||||
description: 'Verbose output'
|
|
||||||
required: false
|
|
||||||
default: true
|
|
||||||
token:
|
|
||||||
description: 'GitHub token'
|
|
||||||
required: true
|
|
||||||
default: ${{ github.token }}
|
|
||||||
runs:
|
|
||||||
using: 'docker'
|
|
||||||
image: '<%= pages_action_url %>'
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#! /usr/bin/env ruby
|
|
||||||
|
|
||||||
# Internal: Generate an action.yml metadata file using the inputs
|
|
||||||
#
|
|
||||||
# pages_action_url - Docker image URL to be used as the base action image.
|
|
||||||
|
|
||||||
require 'erb'
|
|
||||||
require 'securerandom'
|
|
||||||
|
|
||||||
nonce = SecureRandom.hex
|
|
||||||
pages_action_url = ARGV[0]
|
|
||||||
|
|
||||||
action_erb_path = File.dirname(__FILE__) + '/../action.yml.erb'
|
|
||||||
|
|
||||||
result = File.open(action_erb_path, 'r') do |file|
|
|
||||||
ERB.new(file.read).result(binding)
|
|
||||||
end
|
|
||||||
|
|
||||||
puts result
|
|
||||||
Reference in New Issue
Block a user