-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (74 loc) · 2.93 KB
/
release-udp-exporter.yml
File metadata and controls
86 lines (74 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release ADOT X-Ray UDP Exporter
on:
workflow_dispatch:
inputs:
udp-exporter-version:
description: The version to tag the release with, e.g., 1.2.0
required: true
env:
RUBY_VERSION: "3.2"
permissions:
id-token: write
contents: write
jobs:
validate-udp-exporter-e2e-test:
name: "Validate X-Ray UDP Exporter E2E Test Succeeds"
uses: ./.github/workflows/udp-exporter-e2e-test.yml
secrets: inherit
permissions:
id-token: write
release-udp-exporter:
runs-on: ubuntu-latest
needs: validate-udp-exporter-e2e-test
steps:
- name: Checkout Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
# Install ruby and bundle dependencies and cache!
- name: Install Ruby ${{ env.RUBY_VERSION }} with dependencies
uses: ruby/setup-ruby@v1.221.0
with:
ruby-version: "${{ env.RUBY_VERSION }}"
working-directory: "exporter/xray-udp"
bundler: "latest"
bundler-cache: true
cache-version: "v1-ruby-xray-udp"
- name: Run Unit Tests
working-directory: "exporter/xray-udp"
run: |
bundle install
bundle exec rake test
- name: Build gem
working-directory: "exporter/xray-udp"
run: |
gem build aws-distro-opentelemetry-exporter-xray-udp.gemspec
- name: Validate gem version matches workflow input
working-directory: "exporter/xray-udp"
run: |
if [[ ! -f aws-distro-opentelemetry-exporter-xray-udp-${{ inputs.udp-exporter-version }}.gem ]]; then
echo "Input version '${{ inputs.udp-exporter-version }}' does not match with UDP Exporter gem version"
exit 1
fi
- name: Set API key credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_UDP_EXPORTER_API_KEY }}
- name: Push gem
working-directory: "exporter/xray-udp"
run: gem push aws-distro-opentelemetry-exporter-xray-udp-${{ inputs.udp-exporter-version }}.gem
- name: Clear credentials
run: rm -f ~/.gem/credentials
# Publish to GitHub releases
- name: Create GH release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
run: |
gh release create --target "$GITHUB_REF_NAME" \
--title "Release aws-distro-opentelemetry-exporter-xray-udp v${{ inputs.udp-exporter-version }}" \
--notes "Please refer to the [Changelog](https://github.com/aws-observability/aws-otel-ruby/blob/main/exporter/xray-udp/CHANGELOG.md) for more details" \
--draft \
"v${{ inputs.udp-exporter-version }}"