-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (58 loc) · 1.9 KB
/
release-github-template.yml
File metadata and controls
66 lines (58 loc) · 1.9 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
#SPDX-FileCopyrightText: 2017-2024 Enedis
#SPDX-License-Identifier: Apache-2.0
name: "Release on Github"
on:
workflow_call:
inputs:
publish-to-github-maven-registry:
default: true
type: boolean
description: "Skip publish-to-github-maven-registry if false"
jobs:
create-github-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: 'TODO'
draft: false
prerelease: false
outputs:
RELEASE_PATH: ${{ steps.create_release.outputs.upload_url }}
publish-to-github-maven-registry:
uses: ./.github/workflows/build-all-template.yml
if: ${{inputs.publish-to-github-maven-registry}}
with:
release: true
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
maven-username: ${{ github.actor }}
maven-password: ${{ secrets.GITHUB_TOKEN }}
upload-plugin-to-release:
permissions:
contents: write
needs: [ create-github-release]
runs-on: ubuntu-latest
steps:
- name: get plugin artifacts from build job
uses: actions/download-artifact@v4
with:
name: plugin-artifacts
path: artifacts
- name: Upload artifacts to github release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-github-release.outputs.RELEASE_PATH }}
asset_path: artifacts/idea-plugin/build/distributions/chutney-idea-plugin-${{ github.ref_name }}.zip
asset_name: chutney-idea-plugin-${{ github.ref_name }}.zip
asset_content_type: application/zip