-
Notifications
You must be signed in to change notification settings - Fork 132
86 lines (77 loc) · 2.55 KB
/
release.yml
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
on:
push:
tags:
- "v[0-9]+*"
branches:
- main
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
permissions:
attestations: write
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: RubyGems login
run: |
RUBY_HOME="${HOME}/.gem"
RUBY_CREDENTIALS_FILE="${RUBY_HOME}/credentials"
mkdir -p "${RUBY_HOME}"
echo '---' > "${RUBY_CREDENTIALS_FILE}"
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" >> "${RUBY_CREDENTIALS_FILE}"
chmod 0600 "${RUBY_CREDENTIALS_FILE}"
- name: Install build system
run: .ci/scripts/install-build-system.sh
- name: rake release (only for tags)
run: rake release
if: startsWith(github.ref, 'refs/tags')
- name: rake build
run: rake build
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
- name: generate build provenance
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ github.workspace }}/pkg/*.gem"
update-branch:
needs:
- release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Setup Git
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
- name: Install build system
run: .ci/scripts/install-build-system.sh
- name: rake release:update_branch (only for tags)
run: rake release:update_branch
if: startsWith(github.ref, 'refs/tags')
status:
if: always()
runs-on: ubuntu-latest
needs:
- release
- update-branch
steps:
- id: check
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
with:
needs: ${{ toJSON(needs) }}
- run: ${{ steps.check.outputs.isSuccess }}
- if: ${{ always() && startsWith(github.ref, 'refs/tags') }}
uses: elastic/oblt-actions/slack/notify-result@v1
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-ruby"
message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"