-
Notifications
You must be signed in to change notification settings - Fork 15
153 lines (133 loc) · 5.35 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# AmiSSL Release build
name: Release Build
on:
workflow_dispatch:
jobs:
release_draft:
name: Release draft
runs-on: ubuntu-20.04
outputs:
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
version: ${{ steps.env.outputs.version }}
date: ${{ steps.env.outputs.date }}
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Environment
id: env
shell: bash
run: |
BUILD_DATE=$(date +%Y%m%d)
VERSION=$(grep ^VERSION= Makefile | awk -F= '{ print $2 }')
AMISSLMASTERREVISION=$(grep ^AMISSLMASTERREVISION= Makefile | awk -F= '{ print $2 }')
echo "::set-output name=version::${VERSION}.${AMISSLMASTERREVISION}"
echo "::set-output name=date::${BUILD_DATE}"
- name: Get previous tag
id: previoustag
uses: WyriHaximus/[email protected]
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Generate release notes
shell: bash
run: |
export CHANGELOG="$(tac <<'EOF'
${{ steps.changelog.outputs.changelog }}
EOF
)"
export VERSION=${{ steps.env.outputs.version }}
export PREVIOUS_TAG=${{ steps.previoustag.outputs.tag }}
envsubst <.github/release-template.md >/tmp/release-template.md
- name: Create release draft
id: release_drafter
uses: ncipollo/[email protected]
with:
tag: ${{ steps.env.outputs.version }}
name: 'AmiSSL ${{ steps.env.outputs.version }}'
bodyFile: /tmp/release-template.md
draft: true
prerelease: false
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
build:
name: Release build
runs-on: ubuntu-20.04
timeout-minutes: 480
needs: release_draft
strategy:
fail-fast: false
steps:
- uses: actions/[email protected]
- name: setup dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -y -qq || true
sudo apt-get -qq install libc6:i386
sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
- name: setup env
run : |
echo "GITHUB_SHA7=$(echo ${GITHUB_SHA::7})" >>$GITHUB_ENV
echo "BUILD_DATE=$(date +'%Y%m%d')" >>$GITHUB_ENV
- name: install adtools build env
run: |
DOWNLOAD_PATH=https://github.com/adtools/adtools/releases/download/20170213
DOWNLOAD_PATH_UTILS=https://github.com/adtools/adtools/releases/download/20220416
curl -L ${DOWNLOAD_PATH_UTILS}/adtools-utils.tar.bz2 | sudo tar xj -C /
curl -L ${DOWNLOAD_PATH}/adtools-m68k-amigaos.tar.bz2 | sudo tar xj -C /
curl -L ${DOWNLOAD_PATH}/adtools-ppc-amigaos-legacy.tar.bz2 | sudo tar xj -C /
curl -L ${DOWNLOAD_PATH}/adtools-ppc-amigaos.tar.bz2 | sudo tar xj -C /
#curl -L ${DOWNLOAD_PATH}/adtools-ppc-morphos.tar.bz2 | sudo tar xj -C /
#curl -L ${DOWNLOAD_PATH}/adtools-ppc-aros.tar.bz2 | sudo tar xj -C /
#curl -L ${DOWNLOAD_PATH}/adtools-i386-aros.tar.bz2 | sudo tar xj -C /
#curl -L ${DOWNLOAD_PATH}/adtools-x86_64-aros.tar.bz2 | sudo tar xj -C /
#- name: remote debug tmate session
# uses: mxschmitt/action-tmate@v1
# major build step
- name: build AmiSSL release
timeout-minutes: 480
run: |
sudo rm /usr/local/amiga/bin/ppc-amigaos-strip
export PATH=/usr/local/amiga/bin:/opt/m68k-amigaos/bin:/opt/ppc-amigaos/bin:/opt/ppc-morphos/bin:${PATH}
make -j1 release
- name: upload release archive as workflow artifact
uses: actions/upload-artifact@v4
with:
path: |
AmiSSL-${{ needs.release_draft.outputs.version }}.lha
AmiSSL-${{ needs.release_draft.outputs.version }}.lha.sha256
AmiSSL-${{ needs.release_draft.outputs.version }}.readme
name: AmiSSL-${{ needs.release_draft.outputs.version }}-${{ env.GITHUB_SHA7 }}
continue-on-error: true
#######################
# release uploads
- name: Upload release archive
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_draft.outputs.upload_url }}
asset_path: AmiSSL-${{ needs.release_draft.outputs.version }}.lha
asset_name: AmiSSL-${{ needs.release_draft.outputs.version }}.lha
asset_content_type: application/x-lha
- name: Upload release archive [sha256]
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_draft.outputs.upload_url }}
asset_path: AmiSSL-${{ needs.release_draft.outputs.version }}.lha.sha256
asset_name: AmiSSL-${{ needs.release_draft.outputs.version }}.lha.sha256
asset_content_type: text/plain
- name: Upload release archive [readme]
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_draft.outputs.upload_url }}
asset_path: AmiSSL-${{ needs.release_draft.outputs.version }}.readme
asset_name: AmiSSL-${{ needs.release_draft.outputs.version }}.readme
asset_content_type: text/plain