-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.66 KB
/
Shared-Validate-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
# *************************************************************************
# ** Copyright (c) 2022-24 CentraleSupélec & EDF.
# ** All rights reserved. This program and the accompanying materials
# ** are made available under the terms of the Eclipse Public License v2.0
# ** which accompanies this distribution, and is available at
# ** https://www.eclipse.org/legal/epl-v20.html
# **
# ** This file is part of the RiseClipse tool
# **
# ** Contributors:
# ** Computer Science Department, CentraleSupélec
# ** EDF R&D
# ** Contacts:
# ** [email protected]
# ** [email protected]
# ** Web site:
# ** https://riseclipse.github.io
# *************************************************************************
name: Validate release on GitHub
# This CD workflow switch from pre-release to release on GitHub
# It aslo uploads artifacts without the rc
on:
workflow_call:
outputs:
release_version:
description: "Version of the release"
value: ${{ jobs.release.outputs.release_version }}
jobs:
release:
# Use a specific version to avoid unattended changes with latest
runs-on: ubuntu-22.04
name: Validate release
outputs:
release_version: ${{ steps.get_version.outputs.project_version }}
steps:
- name: Setup Environment
run: sudo apt-get install -y rename
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v4
- name: Download artifact from other workflow
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: Pre-Release-and-Prepare-Next-Dev.yml
workflow_conclusion: success
path: ${{ github.workspace }}/artifacts
- name: Get version from any artifact name
run: |
cd artifacts
FILENAME=$(basename */*.jar )
VERSION=${FILENAME##*-}
VERSION=${VERSION%.jar}
echo "project_version=$VERSION" >> $GITHUB_OUTPUT
id: get_version
- name: Rename folder to avoid errors
run: |
cd ${{ github.workspace }}/artifacts
rename 's/.jar//' *.jar
- uses: ncipollo/release-action@v1
with:
replacesArtifacts: true
allowUpdates: true
artifacts: "${{ github.workspace }}/artifacts/**/*.jar"
body: "This release contains the latest build of this RiseClipse tool."
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.repository.name }}-${{ steps.get_version.outputs.project_version }}
prerelease: false
name: ${{ github.event.repository.name }} v${{ steps.get_version.outputs.project_version }}
removeArtifacts: true