-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 2.86 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
87
88
89
90
91
92
93
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+\\+[0-9]+"
jobs:
build:
uses: ./.github/workflows/build.yml
set-release-info:
needs: build
runs-on: ubuntu-latest
outputs:
SKIP_RELEASE: ${{ steps.assemble-release-info.outputs.SKIP_RELEASE }}
RELEASE_VERSION: ${{ steps.assemble-release-info.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Assemble release info
id: assemble-release-info
run: |
set -vx
. .github/workflows/release_info.sh ${{ github.event.repository.full_name }}
echo CHANGELOG=$(echo -e "${CHANGELOG}") >> $GITHUB_ENV
echo IS_CANDIDATE=${IS_CANDIDATE} >> $GITHUB_ENV
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
echo "SKIP_RELEASE=${SKIP_RELEASE}" >> $GITHUB_OUTPUT
docker:
if: needs.set-release-info.outputs.SKIP_RELEASE == 'false'
needs: set-release-info
uses: ./.github/workflows/docker-push.yml
with:
RELEASE_VERSION: ${{ needs.set-release-info.outputs.RELEASE_VERSION }}
release:
needs: [docker, set-release-info]
if: needs.set-release-info.outputs.SKIP_RELEASE == 'false'
runs-on: ubuntu-latest
env:
OWNER: ${GITHUB_REPOSITORY%/*}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: build
path: ./build
- name: Create release
id: create-release
uses: softprops/action-gh-release@v1
with:
draft: false
name: ${{ github.event.repository.name }} ${{ github.ref_name }}
prerelease: ${{ env.IS_CANDIDATE }}
tag_name: ${{ github.ref }}
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_unmatched_files: true
files: ./build/distributions/*.zip
- name: Checkout plugin repo
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: one-thd/spinnaker-plugins
ssh-key: ${{ secrets.SPINNAKER_PLUGINS_REPO_SSH }}
path: spinnaker-plugins
- name: Add plugin release
run: |
set -vx
go run .github/workflows/addPluginReleaseToRepo.go "{\"org\": \"${{ env.OWNER }}\", \"repo\": \"${{ github.event.repository.name }}\", \"release\": $(cat build/distributions/plugin-info.json)}"
- name: Commit and push
run: |
set -vx
cd spinnaker-plugins
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add plugin release ${{ needs.set-release-info.outputs.RELEASE_VERSION }}"
git push origin main