-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tonycthsu/update-2.0-with-1.22.0
- Loading branch information
Showing
23 changed files
with
657 additions
and
313 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 |
---|---|---|
@@ -1,49 +1,53 @@ | ||
name: Add milestone to pull requests | ||
name: Add milestone to merged pull requests | ||
on: | ||
pull_request_target: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
add_milestone_to_merged: | ||
permissions: | ||
# These two permissions are needed to modify milestone, even though only one should be enough | ||
issues: write | ||
pull-requests: write | ||
|
||
if: github.event.pull_request.merged && github.event.pull_request.milestone == null | ||
|
||
name: Add milestone to merged pull requests | ||
add_milestone: | ||
runs-on: ubuntu-latest | ||
|
||
if: github.event.pull_request.merged == true && github.event.pull_request.milestone == null | ||
steps: | ||
- name: Checkout code | ||
# Checks out the branch that the pull request is merged into | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.base.ref }} | ||
|
||
- name: Get major version from gemspec | ||
# Parse the gemspec and return the major version | ||
id: version | ||
run: | | ||
echo "::set-output name=version::$(find . -name *.gemspec | ruby -ne 'puts Gem::Specification.load($_.chomp).version.to_s.split(".").first')" | ||
- name: Get project milestones | ||
id: milestones | ||
uses: actions/github-script@v6 | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const list = await github.rest.issues.listMilestones({ | ||
const milestones = await github.rest.issues.listMilestones({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: 'open' | ||
}) | ||
// Need to manually sort because "sort by number" isn't part of the api | ||
// highest number first | ||
const milestones = list.data.sort((a,b) => (b.number - a.number)) | ||
return milestones.data | ||
return milestones.length == 0 ? null : milestones[0].number | ||
- name: Update Pull Request | ||
if: steps.milestones.outputs.result != null | ||
uses: actions/github-script@v6 | ||
# Update the merged pull request with the milestone starts with the major version | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
// Confusingly, the issues api is used because pull requests are issues | ||
await github.rest.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: ${{ github.event.pull_request.number }}, | ||
milestone: ${{ steps.milestones.outputs.result }}, | ||
}); | ||
const milestones = ${{steps.milestones.outputs.result}} | ||
const majorVersion = ${{steps.version.outputs.version}} | ||
const milestone = milestones.find(m => m.title.startsWith(majorVersion)) | ||
if (milestone) { | ||
await github.rest.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: ${{ github.event.pull_request.number }}, | ||
milestone: milestone.number | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
94 changes: 0 additions & 94 deletions
94
.github/workflows/draft-release-on-release-branch-push.yaml
This file was deleted.
Oops, something went wrong.
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,32 +1,32 @@ | ||
# name: "Release Library Injection" | ||
# on: | ||
# push: | ||
# tags: | ||
# - 'v*.*.*' | ||
|
||
# jobs: | ||
# build-and-publish-release-image: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Set version | ||
# id: version | ||
# run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
# - name: Get version | ||
# run: echo "The selected version is ${{ steps.version.outputs.version }}" | ||
# - name: Set up QEMU | ||
# uses: docker/setup-qemu-action@v2 | ||
# - name: Set up Docker Buildx | ||
# id: buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
# - name: Login to Docker | ||
# run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | ||
# - name: Docker Build | ||
# uses: docker/build-push-action@v3 | ||
# with: | ||
# push: true | ||
# tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }} | ||
# platforms: 'linux/amd64,linux/arm64/v8' | ||
# build-args: DATADOG_RUBY_GEM_VERSION=${{ steps.version.outputs.version }} | ||
# context: ./lib-injection | ||
name: "Release Library Injection" | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
- '!v*.*.*.*' # Exclude prerelease tags | ||
|
||
jobs: | ||
build-and-publish-release-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set version | ||
id: version | ||
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: Get version | ||
run: echo "The selected version is ${{ steps.version.outputs.version }}" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker | ||
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | ||
- name: Docker Build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }} | ||
platforms: 'linux/amd64,linux/arm64/v8' | ||
build-args: DDTRACE_RUBY_VERSION=${{ steps.version.outputs.version }} | ||
context: ./lib-injection |
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
Oops, something went wrong.