Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up GH actions for releases #415

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ jobs:
name: "Test grey-row-jumbo"
command: cd exampleSite && ls && pwd && HUGO_ENV=production hugo -v -d workspace/test/grey-row-jumbo --config ../test/grey-row-jumbo-config.toml --themesDir ../.. --theme=castanet --buildDrafts=false

#

create-release:
docker:
- image: cibuilds/github:0.13.0
Expand Down Expand Up @@ -125,6 +127,7 @@ jobs:
VERSION=${CIRCLE_TAG}
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./release/
# this is what ends the commented out part

# publish-github-release:
# docker:
Expand Down Expand Up @@ -178,11 +181,11 @@ workflows:
- test-grey-row-jumbo:
requires:
- build
deploy:
jobs:
- create-release:
filters:
tags:
only: /^\d+\.\d+\.\d+$/
branches:
ignore: /.*/
# deploy:
# jobs:
# - create-release:
# filters:
# tags:
# only: /^\d+\.\d+\.\d+$/
# branches:
# ignore: /.*/
26 changes: 26 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .github/release.yml

changelog:
exclude:
labels:
- ignore-for-release
- duplicate
- question
- invalid
- wontfix
- do-not-merge
- no-changelog
- dependencies
authors:
- dependabot
categories:
- title: Fixed Bugs 🐛
labels:
- bug
- breaking-change
- title: Exciting New Features 🎉
labels:
- Enhancement
- title: Other Changes
labels:
- "*"
70 changes: 70 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Prepare Release
on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release Type'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

# push:
# tags:
# - '*'
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- run: |
echo "Release type: $TYPE"
env:
TYPE: ${{ inputs.releaseType }}
- uses: actions/checkout@master
- name: Get Next Version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
increment: $TYPE
- name: Update theme TOML
run: sed -i '' "s/${{ github.ref_name }}/${{ steps.version.outputs.version }}/g" ./theme.toml
- name: Generate Changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
user: mattstratton
project: castanet
future-release: ${{ steps.version.outputs.version }}
issues: "true"
issuesWoLabels: "false"
pullRequests: "true"
prWoLabels: "false"
compareLink: "false"
excludeLabels: 'duplicate,question,invalid,wontfix,do-not-merge,no-changelog'
- name: Commit changed files
uses: EndBug/add-and-commit@v9
with:
add: '["theme.toml", "CHANGELOG.md"]'
author_name: "Matt Stratton"
author_email: "[email protected]"
message: "Update theme to version ${{ steps.version.outputs.version }}"
tag: "${{ steps.version.outputs.version }} --force"
tag_push: '--force'
# - name: Create Zip File For Release
# uses: thedoctor0/zip-release@master
# with:
# command: "mkdir -p release"
# type: 'zip'
# filename: "release/${{ github.ref_name }}.zip"
# exclusions: '*.git* /*node_modules/* /*exampleSite/* /*.circleci/* /*bin/* /*gulp/* /*images/* /*release/* /*test/* /*utils/* .nvmrc CODE_OF_CONDUCT.md contributing.json CONTRIBUTING.md gulpfile.js lighthouserc.js matt-test.txt netlify.toml package.json package-lock.json'
# - name: Upload Release
# uses: ncipollo/release-action@v1
# with:
# artifacts: "release/${{ github.ref_name }}.zip"
# generateReleaseNotes: true
# makeLatest: true
# token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
# workflow_run:
# workflows: [prepare-release]
# types:
# - completed
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Create Zip File For Release
uses: thedoctor0/zip-release@master
with:
command: "mkdir -p release"
type: 'zip'
filename: "release/${{ github.ref_name }}.zip"
exclusions: '*.git* /*node_modules/* /*exampleSite/* /*.circleci/* /*bin/* /*gulp/* /*images/* /*release/* /*test/* /*utils/* .nvmrc CODE_OF_CONDUCT.md contributing.json CONTRIBUTING.md gulpfile.js lighthouserc.js matt-test.txt netlify.toml package.json package-lock.json'
- name: Upload Release
uses: ncipollo/release-action@v1
with:
artifacts: "release/${{ github.ref_name }}.zip"
generateReleaseNotes: true
makeLatest: true
token: ${{ secrets.GITHUB_TOKEN }}
Loading