-
-
Notifications
You must be signed in to change notification settings - Fork 6
81 lines (70 loc) · 2.26 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
name: Release
on:
push:
tags:
- 'v*'
pull_request:
paths:
- '.github/workflows/release.yml'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: generate zip
run: |
git archive HEAD --output=compose-cd.zip
ls -lh compose-cd.zip
file compose-cd.zip
- name: check arvhived files
run: |
cd ..
mkdir archive-contents
cd archive-contents
unzip ../compose-cd/compose-cd.zip
tree
- name: generate tar.*
run: |
git config tar.tar.bz2.command bzip2
git config tar.tar.bz2.command xz
git config tar.tar.zst.command zstd
git archive HEAD --output=compose-cd.tar.gz
git archive HEAD --output=compose-cd.tar.bz2
git archive HEAD --output=compose-cd.tar.xz
git archive HEAD --output=compose-cd.tar.zst
ls -lh compose-cd.tar.*
file compose-cd.tar.*
- name: generate checksum list
working-directory: ../archive-contents
run: |
cp ../compose-cd/compose-cd.* .
ls -lh
md5sum ./* > ../compose-cd/md5sums.txt
sha1sum ./* > ../compose-cd/sha1sums.txt
sha256sum ./* > ../compose-cd/sha256sums.txt
sha512sum ./* > ../compose-cd/sha512sums.txt
- name: generate upload file list
id: upload-files
run: |
list=$(ls README.md LICENSE compose-cd* ./*sums.txt)
echo "${list}"
list="${list//$'\n'/'%0A'}"
echo "::set-output name=list::${list}"
- name: Pre Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'rc')
with:
draft: true
prerelease: true
generate_release_notes: false
files: ${{ steps.upload-files.outputs.list }}
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc'))
with:
draft: false
prerelease: false
generate_release_notes: true
files: ${{ steps.upload-files.outputs.list }}