-
Notifications
You must be signed in to change notification settings - Fork 24
50 lines (46 loc) · 1.35 KB
/
release.yml
File metadata and controls
50 lines (46 loc) · 1.35 KB
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
---
name: Release
on:
push:
tags:
- '*'
permissions: {}
jobs:
build-release:
# Prevent releases from forked repositories
if: github.repository_owner == 'theforeman'
name: Build the tarball
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
# the "ref: github.ref" is required for the tag to be properly checked out, as a workaround
# for https://github.com/actions/checkout/issues/1638
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.ref }}
- name: Build tarball
run: make dist
- name: Upload tarball to GitHub cache
uses: actions/upload-artifact@v7
with:
name: release-tarball
path: 'foremanctl-*.tar.gz'
retention-days: 1
compression-level: 0
create-release:
needs: build-release
name: Create GitHub release
runs-on: ubuntu-24.04
permissions:
contents: write # clone repo and create release
steps:
- name: Download tarball from GitHub cache
uses: actions/download-artifact@v8
with:
name: release-tarball
- name: Create Release Page
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes foremanctl-*.tar.gz