-
Notifications
You must be signed in to change notification settings - Fork 4
98 lines (94 loc) · 3.13 KB
/
release.yaml
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
# GitHub Actions workflow file.
#
# For more information, visit
# https://docs.github.com/actions/learn-github-actions.
---
name: release
# Makes workflow run on Git tag.
on:
push:
tags:
- "**"
workflow_dispatch:
inputs:
debug:
default: false
description: Use Tmate session for debugging
type: boolean
env:
NPM_CONFIG_CACHE: "${{ github.workspace }}/.cache/npm"
PIP_CACHE_DIR: "${{ github.workspace }}/.cache/pip"
PIP_DISABLE_PIP_VERSION_CHECK: "true"
PIP_ROOT_USER_ACTION: ignore
POETRY_CACHE_DIR: "${{ github.workspace }}/.cache/pypoetry"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring"
jobs:
release:
name: Make GitHub release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
- name: Cache packages
uses: actions/cache@v3
with:
path: |
.cache
.venv
node_modules
key: >-
node-20_python-3.11_${{ runner.os }}_npm-${{
hashFiles('package-lock.json') }}_poetry-${{
hashFiles('poetry.lock') }}
- name: Install Node interpreter
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install Node packages
run: |
node --version
npm --version
npm ci
- name: Install Python interpreter
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Python packages
run: |
python --version
python -m pip --version
python -m pip install poetry
poetry install
- name: Build packages
run: |
sudo apt-get install --yes rpm
node scripts/build_package.js deb ${{ github.ref_name }}
node scripts/build_package.js rpm ${{ github.ref_name }}
- name: Build and publish collection
env:
ANSIBLE_GALAXY_TOKEN: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
run: |
cp CHANGELOG.md ansible_collections/scruffaluff/bootware/
poetry run ansible-galaxy collection build ansible_collections/scruffaluff/bootware
poetry run ansible-galaxy collection publish --token "${ANSIBLE_GALAXY_TOKEN}" scruffaluff-bootware-${{ github.ref_name }}.tar.gz
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body: >-
See the [changelog](https://github.com/scruffaluff/bootware/blob/${{
github.ref_name }}/CHANGELOG.md) for more information.
files: |
scruffaluff-bootware-${{ github.ref_name }}.tar.gz
dist/bootware_${{ github.ref_name }}_all.deb
dist/bootware-${{ github.ref_name }}-1.fc33.noarch.rpm
name: Bootware ${{ github.ref_name }}
tag_name: ${{ github.ref }}
- name: Setup Tmate session if debug enabled
if: >-
${{ always() && github.event_name == 'workflow_dispatch' &&
inputs.debug }}
timeout-minutes: 60
uses: mxschmitt/action-tmate@v3