-
Notifications
You must be signed in to change notification settings - Fork 19
141 lines (134 loc) · 4.46 KB
/
Copy pathpublishing.yml
File metadata and controls
141 lines (134 loc) · 4.46 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Publishing CI
permissions:
contents: read
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
request:
runs-on: ubuntu-24.04
outputs:
message: ${{ steps.commit.outputs.message }}
run: ${{ steps.filter.outputs.run }}
sha: ${{ steps.commit.outputs.sha }}
steps:
- uses: envoyproxy/toolshed/actions/github/should-run@5171ddd579f53dcef432bc54e16e2d2c90864968 # actions-v0.4.13
id: filter
with:
config: |
paths:
- .github/workflows/_publish.yml
- .github/workflows/_publish_release.yml
- .github/workflows/actions.yml
- .github/workflows/bazel.yml
- .github/workflows/docker.yml
- .github/workflows/rust.yml
- .github/workflows/publishing.yml
- actions/python/release/publish/action.yml
- bazel/VERSION.txt
- BINS_VERSION.txt
- actions/VERSION.txt
- docker/build/VERSION.txt
- docker-assets.yaml
- python/VERSION.txt
- name: Get latest commit from main
id: commit
if: fromJSON(steps.filter.outputs.run)
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
SHA=$(gh api /repos/${{ 'envoyproxy/toolshed' || github.repository }}/git/ref/heads/main --jq '.object.sha')
echo "sha=$SHA" >> $GITHUB_OUTPUT
echo "Latest SHA from main: $SHA"
MESSAGE=$(\
gh api "/repos/${REPO}/commits/${SHA}" \
--jq '.commit.message | split("\n") | first')
echo "message=$MESSAGE" >> $GITHUB_OUTPUT
echo "Latest MESSAGE from main: $MESSAGE"
publish:
needs:
- request
if: fromJSON(needs.request.outputs.run || 'false')
permissions:
actions: read
contents: read
id-token: write
# secrets.ENVOY_GPG_SNAKEOIL_KEY_PASSWORD
# secrets.ENVOY_GPG_SNAKEOIL_KEY
uses: ./.github/workflows/_publish.yml
with:
committer-email: "140627008+publish-envoy[bot]@users. noreply.github.com"
committer-name: "publish-envoy[bot]"
conclusion: ${{ matrix.conclusion || 'success' }}
actions-version: ${{ matrix.actions-version }}
bazel-version: ${{ matrix.bazel-version }}
bins-version: ${{ matrix.bins-version }}
docker-version: ${{ matrix.docker-version }}
dry-run: true
event: ${{ matrix.event }}
python-filter-artifacts: ${{ matrix.python-filter-artifacts }}
python-version: ${{ matrix.python-version }}
pypi-repository-url: ${{ matrix.pypi-repository-url || '' }}
sha: ${{ matrix.sha || needs.request.outputs.sha }}
skip: ${{ matrix.skip || (github.event_name != 'pull_request' && matrix.event == 'pull_request') }}
title: ${{ needs.request.outputs.message }}
strategy:
fail-fast: false
matrix:
include:
- sha: ${{ github.event.pull_request.head.sha }}
event: pull_request
- event: push
- event: push
actions-version: 0.0.123
- event: push
bazel-version: 0.2.17
- event: push
bins-version: 0.1.23
- event: push
docker-version: 0.0.1
- event: push
python-version: 0.0.23
- event: push
python-version: 0.0.23
python-filter-artifacts: .
- event: push
python-version: 0.0.23
pypi-repository-url: https://test.pypi.org/legacy/
- event: push
actions-version: 0.0.123
bazel-version: 0.2.17
bins-version: 0.1.23
docker-version: 0.0.1
python-version: 0.0.23
# existing versions
- event: push
actions-version: 0.3.33
bazel-version: 0.3.11
bins-version: 0.1.27
docker-version: 0.0.1
# not pre-existing version
python-version: 0.0.23
- event: push
conclusion: failure
- event: push
skip: true
status:
runs-on: ubuntu-24.04
if: >-
always()
&& github.event_name == 'pull_request'
name: Publishing
needs:
- request
- publish
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
fi
echo "All required jobs passed or were skipped"