-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release the 2nd release candidate of `v1.1.0`. Adds support for automatic tagging of submodules (i.e `./instrument`) upon publishing releases.
- Loading branch information
1 parent
631f236
commit ef28ad5
Showing
7 changed files
with
110 additions
and
2 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,10 @@ | ||
conventional-commits: | ||
- type: Maintenance work | ||
nouns: [chore, doc, docs, release] | ||
labels: [conventional-commit/chore] | ||
- type: New feature | ||
nouns: [feat] | ||
labels: [conventional-commit/feat] | ||
- type: Bug fix | ||
nouns: [fix] | ||
labels: [conventional-commit/fix] |
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,15 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- conventional-commit/chore | ||
- dependencies | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- conventional-commit/feat | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- conventional-commit/fix | ||
- title: '🔧 Maintenance' | ||
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,21 @@ | ||
name: PR Labeler | ||
on: | ||
pull_request: | ||
types: [opened, edited, reopened] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
update-labels: | ||
name: Update PR labels | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write # Needed to update labels | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- name: Assign Labels | ||
uses: mauroalderete/action-assign-labels@671a4ca2da0f900464c58b8b5540a1e07133e915 # v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
conventional-commits: .github/conventional-commits.yml |
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 |
---|---|---|
|
@@ -5,11 +5,14 @@ on: | |
push: | ||
branches: [main] | ||
paths: [internal/version/version.go] | ||
release: | ||
types: [published] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
validate: | ||
if: github.event_name != 'release' | ||
name: Validate Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
|
@@ -64,3 +67,58 @@ jobs: | |
gh release create '${{ steps.version.outputs.tag }}' --draft --generate-notes --target='${{ github.sha }}' --title='${{ steps.version.outputs.tag }}' ${{ contains(steps.version.outputs.tag, '-') && '--prerelease' || '' }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
release: | ||
if: github.event_name == 'release' | ||
name: Tag Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # To be able to create new tags | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
- name: Setup go | ||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5 | ||
with: | ||
go-version: oldstable | ||
cache-dependency-path: '**/go.mod' | ||
- name: Configure git | ||
env: | ||
AUTHOR_NAME: ${{ github.event.release.author.name || 'Github Actions' }} | ||
AUTHOR_EMAIL: ${{ github.event.release.author.email || '[email protected]' }} | ||
run: |- | ||
git config --global user.name "${AUTHOR_NAME}" | ||
git config --global user.email "${AUTHOR_EMAIL}" | ||
- name: Tag all submodules | ||
env: | ||
EVENT_TAG: ${{ github.event.release.tag_name }} | ||
run: |- | ||
for gomod in $(find . -iname go.mod -not -path '*/_*'); do | ||
dir=$(dirname "${gomod}") | ||
mod=$(go -C "${dir}" list -m) | ||
case "${mod}" in | ||
github.com/DataDog/orchestrion) | ||
# This is the main module, the release already tagged it | ||
continue | ||
;; | ||
github.com/DataDog/orchestrion/*) | ||
# This is a submodule, we'll publish it if the prefix matches the directory name | ||
echo "Found sub-module: ${mod} in ${gomod}" | ||
suffix="${mod#'github.com/DataDog/orchestrion/'}" | ||
if [ "${suffix}" != "${dir#'./'}" ]; then | ||
echo "-> Ignoring submodule with mismatched directory path and suffix: ${dir#'./'} != ${suffix}" | ||
continue | ||
fi | ||
tag="${suffix}/${EVENT_TAG}" | ||
echo "-> Adding required submodule tag: ${tag}" | ||
git tag -m "${EVENT_TAG}" "${tag}" | ||
git push origin "${tag}" | ||
;; | ||
*) | ||
# This is not a submodule, we'll skip it | ||
echo "-> Ignorning non-submodule: ${mod} in ${gomod}" | ||
;; | ||
esac | ||
done |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/DataDog/orchestrion/samples | ||
module github.com/DataDog/orchestrion/_samples | ||
|
||
go 1.22.5 | ||
|
||
|