-
Notifications
You must be signed in to change notification settings - Fork 14
70 lines (60 loc) · 2.25 KB
/
create-release-arccore.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
# Il faut que le tag soit de la forme 'arccore-v2.3.4'
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'arccore-v*'
name: Create Release Arccore
# TODO: Vérifier que le numéro de version du tag correspond
# au fichier 'version' dans le composant correspondant
# (par exemple si 'arccore-v2.3.2' alors le fichier 'framework/arccore/version'
# doit valoir cela aussi)
jobs:
build:
env:
COMPONENT_NAME: arccore
COMPONENT_NAME_UPPER: Arccore
name: Create Release Arccore
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
path: framework
- name: Get the version
id: get_tag_version
run: echo "m_VERSION=${GITHUB_REF/refs\/tags\/${COMPONENT_NAME}-v/}" >> $GITHUB_ENV
- name: Export tag version
shell: 'bash'
run: |
export FRAMEWORK_TAG_VERSION=${{ env.m_VERSION }}
echo FRAMEWORK_TAG_VERSION = $FRAMEWORK_TAG_VERSION
echo "FRAMEWORK_TAG_VERSION=$FRAMEWORK_TAG_VERSION" >> $GITHUB_ENV
- name: Make ${{ env.COMPONENT_NAME }} tar
shell: 'bash'
run: |
echo Creating tar file for ${COMPONENT_NAME}
tar cfz ${COMPONENT_NAME}.tar.gz --transform "s,^${COMPONENT_NAME},${COMPONENT_NAME}-${FRAMEWORK_TAG_VERSION}," -C framework ${COMPONENT_NAME}
ls -lart .
tar tvf ${COMPONENT_NAME}.tar.gz
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ env.COMPONENT_NAME_UPPER }} Version ${{ env.FRAMEWORK_TAG_VERSION }}
body: |
Release ${{ env.FRAMEWORK_TAG_VERSION }}
draft: false
prerelease: true
- name: Upload asset 1 to GitHub release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.COMPONENT_NAME }}.tar.gz
asset_name: ${{ env.COMPONENT_NAME }}-${{ env.FRAMEWORK_TAG_VERSION }}.src.tar.gz
asset_content_type: application/gzip