forked from copperspice/copperspice
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (119 loc) · 4.36 KB
/
patch.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
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
name: 'patch'
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
env:
MODULE_NAME: CopperSpice
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Setup environment
shell: bash
run: |
git config --global core.autocrlf input
- name: Git pull
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Get top commit details
uses: actions/[email protected]
id: author-date
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const commit_details = await github.git.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha
});
return commit_details.data.author.date
- name: Setup environment
run: |
export COMMITTED_AT=$(date -d ${{ steps.author-date.outputs.result }} +'%Y.%m.%d_%H.%M.%S')
echo "COMMITTED_AT=$COMMITTED_AT" >> $GITHUB_ENV
echo "ARTIFACT_JAMMY_GCC_DEBUG=jammy-gcc_debug" >> $GITHUB_ENV
echo "ARTIFACT_JAMMY_GCC_RELEASE=jammy-gcc_release" >> $GITHUB_ENV
echo "ARTIFACT_WINDOWS_CL_DEBUG=windows-cl_debug" >> $GITHUB_ENV
echo "ARTIFACT_WINDOWS_CL_RELEASE=windows-cl_release" >> $GITHUB_ENV
- name: Download CopperSpice Release
uses: robinraju/[email protected]
with:
repository: Apotell/copperspice
latest: true
filename: '*.tar.gz'
out-file-path: out
extract: false
token: ${{ secrets.GHA_DAVENCHE_CI_TOKEN }}
- name: List directory contents
run: |
pushd out
ls -l
for artifact in "${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}" "${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}" "${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}" "${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}"
do
echo $artifact
tar xzfp $artifact.tar.gz
rm $artifact.tar.gz
ls -l
cp ../deploy/CMakeLists.txt ${{ env.MODULE_NAME }}/.
tar czfp $artifact.tar.gz ${{ env.MODULE_NAME }}
rm -rf ${{ env.MODULE_NAME }}
ls -l
done
ls -l
popd
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.COMMITTED_AT }}
release_name: ${{ env.MODULE_NAME }}
draft: false
prerelease: false
- name: Upload Release Asset (jammy-gcc_debug)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}.tar.gz
asset_name: ${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}.tar.gz
asset_content_type: application/zip
- name: Upload Release Asset (jammy-gcc_release)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}.tar.gz
asset_name: ${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}.tar.gz
asset_content_type: application/zip
- name: Upload Release Asset (windows-cl_debug)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}.tar.gz
asset_name: ${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}.tar.gz
asset_content_type: application/zip
- name: Upload Release Asset (windows-cl_release)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}.tar.gz
asset_name: ${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}.tar.gz
asset_content_type: application/zip
- name: Delete some old releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}