-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add MIT license * Add emojis, and “Alternatives” section * Add documentation * Add SPI manifest * Rename targets * DirectoryWatcher -> Watcher * DirectoryWatcherCore -> WatcherCore * DirectoryWatcherCoreTests -> WatcherCoreTests * Update README * DirectoryWatcherError -> WatcherError * Update template * Update Makefile, build docs * Fix tests * Add test workflow * Fix runner image * Update triggers, dependencies * Remove verbose * Support version option * Add documentation for the release process * Implement workflows * Update SPI manifest doc targets * Fix target * Add configuration article * Add installation article * Rename workflow; update docs * Test before release * Add release configuration * Exclude automated PRs * Create release with workflow * Workflow fixes and improvements * Upgrade swift-version-file-plugin * Upgrade action dependency
- Loading branch information
Showing
37 changed files
with
409 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options | ||
changelog: | ||
exclude: | ||
labels: | ||
- ci | ||
- ignore-for-release | ||
authors: | ||
- github-actions | ||
- octocat | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: | ||
- semver/major | ||
- breaking-change | ||
- title: New Features 🎉 | ||
labels: | ||
- semver/minor | ||
- enhancement | ||
- title: Bug Fixes 🐛 | ||
labels: | ||
- semver/patch | ||
- bug | ||
- title: Other Changes | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Release | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
if: github.event.pull_request.merged == true && github.head_ref == 'release' | ||
uses: mobelux/Watcher/.github/workflows/test.yml@main | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true && github.head_ref == 'release' | ||
needs: test | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get version | ||
id: get-version | ||
shell: bash | ||
run: | | ||
VERSION=$(grep -Eo '([0-9]+\.*)+' ${{ vars.VERSION_FILE_PATH }}) | ||
echo "current-version=$VERSION" >> $GITHUB_ENV | ||
- name: Push tag | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ env.current-version }}', | ||
sha: '${{ github.sha }}' | ||
}) | ||
- name: Create release | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.repos.createRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag_name: '${{ env.current-version }}', | ||
generate_release_notes: true, | ||
draft: false, | ||
prerelease: false | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Prepare Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
description: Type of release | ||
type: choice | ||
required: true | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Bump Version file | ||
id: bump | ||
run: | | ||
echo "version=$(swift package --allow-writing-to-package-directory version-file --target watcher --bump ${{ inputs.release_type }})" >> $GITHUB_OUTPUT | ||
- name: Create pull request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: Bump Version.swift -> ${{ steps.bump.outputs.version }} | ||
committer: GitHub <noreply@github.com> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
branch: release | ||
delete-branch: true | ||
title: '[CI] Prepare Version ${{ steps.bump.outputs.version }} Release' | ||
body: | | ||
Update `Version.swift` with bumped version number. | ||
draft: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
jobs: | ||
unit_tests: | ||
if: github.event.pull_request.draft == false | ||
name: Run Tests | ||
runs-on: macos-13 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: swift build | ||
|
||
- name: Run tests | ||
run: swift test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: 1 | ||
builder: | ||
configs: | ||
- documentation_targets: [watcher, WatcherCore] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Mobelux LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Release Instructions | ||
|
||
This tool uses the [swift-version-file-plugin](https://github.com/Mobelux/swift-version-file-plugin) Swift Package Manager command plugin to maintain a source file--[`Sources/watcher/Version.swift`](Sources/watcher/Version.swift)--supplying the value that is returned when the tool is run with the `--version` option. To ensure that this is properly maintained, releases should only be created using the [`Prepare Release`](http://github.com/Mobelux/Watcher/actions/workflows/prepare-release.yml) workflow. Run the workflow using `workflow_dispatch` event trigger from the `main` branch with the appropriate release type. This will create a new PR on a `release` branch containing an update to the Version file. Add any additional changes related to the release, like updating a changelog, to this PR. Finally, merge the `release` branch into `main` to delete it and trigger the [`Create Release`](.github/workflows/create-release.yml) workflow. This will create a new tag corresponding to the value of the updated Version file and a new release. |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...oryWatcherCore/CommandConfiguration.swift → ...es/WatcherCore/CommandConfiguration.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Configuration.swift | ||
// DirectoryWatcher | ||
// Watcher | ||
// | ||
// Created by Mathew Gacy on 6/23/23. | ||
// | ||
|
2 changes: 1 addition & 1 deletion
2
Sources/DirectoryWatcherCore/Constants.swift → Sources/WatcherCore/Constants.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Constants.swift | ||
// DirectoryWatcher | ||
// Watcher | ||
// | ||
// Created by Mathew Gacy on 6/23/23. | ||
// | ||
|
Oops, something went wrong.