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

release: v0.7.2 #148

Merged
merged 2 commits into from
Jul 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
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Release
on:
pull_request:
paths: ['internal/version.go']
paths: ['internal/version/version.go']
push:
branches: ['main']
paths: ['internal/version.go']
paths: ['internal/version/version.go']

jobs:
validate:
Expand Down Expand Up @@ -39,9 +39,17 @@ jobs:

# If this is a pull request, and the release does not yet exist, the PR title must be "release: <tag>"
- name: 'Pull Request title must be "release: ${{ steps.version.outputs.tag }}"'
if: "github.event_name == 'pull_request' && steps.version.outputs.exists == 'false' && github.event.pull_request.title != 'release: ${{ steps.version.outputs.tag }}'"
if: "github.event_name == 'pull_request' && !fromJSON(steps.version.outputs.exists) && format('release: {0}', steps.version.outputs.tag) != github.event.pull_request.title"
run: |-
echo 'Please update the PR title to "release: ${{ steps.version.outputs.tag }}"'
echo 'Please update the PR title to "release: ${{ steps.version.outputs.tag }}" (instead of ${{ toJSON(github.event.pull_request.title) }})'
exit 1

# Release must not already exist (if the PR title suggests this is intended to be a release)
- name: Release ${{ steps.version.outputs.tag }} already exists
if: github.event_name == 'pull_request' && fromJSON(steps.version.outputs.exists) && startsWith(github.event.pull_request.title, 'release:')
run: |-
echo 'A release already exists for tag ${{ steps.version.outputs.tag }}. Please update to another version.'
exit 1

# If the release does not yet exist, create a draft release targeting this commit.
- name: Create draft release
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
package version

// Tag specifies the current release tag. It needs to be manually updated.
const Tag = "v0.7.1"
const Tag = "v0.7.2"
11 changes: 10 additions & 1 deletion pin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func TestPin(t *testing.T) {
}

func scaffold(dir string) error {
_, thisFile, _, _ := runtime.Caller(0)
thisDir := filepath.Dir(thisFile)

goMod, err := os.Create(filepath.Join(dir, "go.mod"))
if err != nil {
return err
Expand All @@ -50,7 +53,13 @@ func scaffold(dir string) error {
if _, err := fmt.Fprintln(goMod); err != nil {
return err
}
if _, err := fmt.Fprintf(goMod, "go %s", runtime.Version()[2:6]); err != nil {
if _, err := fmt.Fprintf(goMod, "go %s\n", runtime.Version()[2:6]); err != nil {
return err
}
if _, err := fmt.Fprintln(goMod); err != nil {
return err
}
if _, err := fmt.Fprintf(goMod, "replace github.com/datadog/orchestrion %s => %s\n", version.Tag, thisDir); err != nil {
return err
}

Expand Down
Loading