-
Notifications
You must be signed in to change notification settings - Fork 130
64 lines (64 loc) · 2.13 KB
/
pre-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
---
name: Create Pre-Release
on:
push:
branches:
- master
jobs:
build:
name: Create Pre-Release
runs-on: ubuntu-latest
steps:
# CHECKOUT CODE
- name: Checkout code
uses: actions/checkout@v4
# BUILD THE .DEB PACKAGE
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y build-essential devscripts debhelper
sudo debuild --buildinfo-option=-O -us -uc -b -j8
find ../ -name "*.deb" -exec mv {} cis-hardening.deb \;
# DELETE THE TAG NAMED LATEST AND THE CORRESPONDING RELEASE
- name: Delete the tag latest and the release latest
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GET LATEST VERSION TAG
- name: Get latest version tag
uses: actions-ecosystem/[email protected]
id: get-latest-tag
# GENERATE CHANGELOG CORRESPONDING TO COMMIT BETWEEN HEAD AND COMPUTED LAST TAG
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ github.sha }}
base-ref: ${{ steps.get-latest-tag.outputs.tag }}
# CREATE RELEASE NAMED LATEST
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
release_name: Pre-release
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: true
# UPLOAD PACKAGE .DEB
- name: Upload Release deb
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cis-hardening.deb
asset_name: cis-hardening.deb
asset_content_type: application/vnd.debian.binary-package