Skip to content
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
39 changes: 39 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Changelog

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
- labeled
- unlabeled
paths:
- '**.go'
- '**/go.mod'
- '**/go.sum'

jobs:
changelog:
if: contains(github.event.pull_request.title, '[skip changelog]') == false &&
contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false
runs-on: ubuntu-latest
name: Changelog
steps:
- id: changelog
env:
GITHUB_TOKEN: ${{ github.token }}
ENDPOINT: repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files
SELECTOR: 'map(select(.filename == "CHANGELOG.md")) | length'
run: gh api "$ENDPOINT" --jq "$SELECTOR" | xargs -I{} echo "modified={}" | tee -a $GITHUB_OUTPUT
- if: steps.changelog.outputs.modified == '0'
env:
MESSAGE: |
CHANGELOG.md was not modified in this PR. Please do one of the following:
- add a changelog entry
- add `[skip changelog]` to the PR title
- label the PR with `skip/changelog`
run: |
echo "::error::${MESSAGE//$'\n'/%0A}"
exit 1
31 changes: 30 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
name: Create and publish a Docker image

on:
workflow_dispatch:
push:
branches: ['main', 'staging']
tags: ['v*']
workflow_run:
workflows: [Releaser]
types:
- completed

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
prepare_checkout:
if: (
github.repository == 'ipfs/someguy'
|| github.event_name == 'workflow_dispatch'
) && (
github.event_name != 'workflow_run'
|| github.event.workflow_run.conclusion == 'success'
)
name: Decide what ref to check out
runs-on: ubuntu-latest
outputs:
ref: ${{ github.event_name != 'workflow_run' && github.ref || steps.releaser.outputs.version }}
steps:
- name: Inspect triggering Releaser workflow run
id: releaser
if: github.event_name == 'workflow_run'
uses: ipdxco/unified-github-workflows/.github/actions/inspect-releaser@v1.0
with:
artifacts-url: ${{ github.event.workflow_run.artifacts_url }}
build-and-push-image:
needs: [prepare_checkout]
if: needs.prepare_checkout.outputs.ref != ''
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.prepare_checkout.outputs.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -43,7 +72,7 @@ jobs:
IMAGE_NAME: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
run: |
echo "value<<EOF" >> $GITHUB_OUTPUT
./.github/scripts/get-docker-tags.sh "$(date -u +%F)" >> $GITHUB_OUTPUT
./docker/get-docker-tags.sh "$(date -u +%F)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
shell: bash
- name: Build Docker image and publish to Docker Hub
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file.

Note:
* The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
* This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Legend
The following emojis are used to highlight certain changes:
* 🛠 - BREAKING CHANGE. Action is required if you use this functionality.
* ✨ - Noteworthy change to be aware of.

## [Unreleased]

### Added

### Changed

### Removed

### Fixed

### Security
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ Suggested method for self-hosting is to run a [prebuilt Docker image](#docker).

## Release

To make a release, create a new PR that updates the [`version.json`](./version.json) file. This PR should not include any other changes besides the version bump. A new release will be automatically made once the PR is merged
1. Create a PR from branch `release-vX.Y.Z` against `main` that:
1. Tidies the [`CHANGELOG.md`](CHANGELOG.md) with the changes for the current release
2. Updates the [`version.json`](./version.json) file
2. Once the release checker creates a draft release, copy-paste the changelog into the draft
3. Merge the PR, the release will be automatically created once the PR is merged

## License

Expand Down