forked from freebsd/uefi-edk2
-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (95 loc) · 3.49 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
name: Publish Release
on:
push:
tags:
- '*il*'
jobs:
build:
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Submodules
run: git submodule update --init .
- name: Set version string
id: version
run: |
echo "GITHUB_REPOSITORY = $GITHUB_REPOSITORY"
echo "GITHUB_REF = $GITHUB_REF"
echo "::set-output name=v::${GITHUB_REPOSITORY##*/}-${GITHUB_REF##*/}"
echo "::set-output name=b::${GITHUB_REF##*/}"
- name: Create archive
run: tar cvf release.tar --owner=root --group=root --exclude '.git*' --exclude .azurepipelines --transform 's^.^${{ steps.version.outputs.v }}^' --show-stored-names .
- name: Compress
run: |
gzip -9vc release.tar > release.tar.gz
bzip2 -9vc release.tar > release.tar.bz2
xz -9vc release.tar > release.tar.xz
sha256sum release.tar.gz > release.tar.gz.sha256
sha256sum release.tar.bz2 > release.tar.bz2.sha256
sha256sum release.tar.xz > release.tar.xz.sha256
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.b }}
release_name: Release ${{ steps.version.outputs.b }}
draft: false
prerelease: false
- name: Upload gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.tar.gz
asset_name: ${{ steps.version.outputs.v }}.tar.gz
asset_content_type: application/gzip
- name: Upload gz checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.tar.gz.sha256
asset_name: ${{ steps.version.outputs.v }}.tar.gz.sha256
asset_content_type: text/plain
- name: Upload bz2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.tar.bz2
asset_name: ${{ steps.version.outputs.v }}.tar.bz2
asset_content_type: application/bzip2
- name: Upload bz2 checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.tar.bz2.sha256
asset_name: ${{ steps.version.outputs.v }}.tar.bz2.sha256
asset_content_type: text/plain
- name: Upload xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.tar.xz
asset_name: ${{ steps.version.outputs.v }}.tar.xz
asset_content_type: application/xz
- name: Upload xz checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release.tar.xz.sha256
asset_name: ${{ steps.version.outputs.v }}.tar.xz.sha256
asset_content_type: text/plain