-
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (103 loc) · 4.1 KB
/
Copy pathrelease.yml
File metadata and controls
125 lines (103 loc) · 4.1 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# ==============================================================================
# GitHub Actions Release Pipeline for Apotropaios
# Description: Full test suite + security scan, version verification,
# distribution build, and GitHub Release creation.
# Version: 1.1.5
# ==============================================================================
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
security-events: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
verify-and-test:
name: Verify & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Verify tag matches script version
run: |
SCRIPT_VERSION=$(grep -m1 'APOTROPAIOS_VERSION=' lib/core/constants.sh | cut -d'"' -f2)
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "${SCRIPT_VERSION}" != "${TAG_VERSION}" ]; then
echo "::error::Tag (${TAG_VERSION}) != script (${SCRIPT_VERSION})"; exit 1
fi
echo "Version verified: ${SCRIPT_VERSION}"
- name: Install tools
run: |
sudo apt-get install -y shellcheck
git clone --depth 1 https://github.com/bats-core/bats-core.git /tmp/bats
sudo /tmp/bats/install.sh /usr/local
- name: Syntax check + lint
run: make lint
- name: Unit tests
run: |
mkdir -p test-results
bats tests/unit/ --tap > test-results/unit.tap 2>&1 || { cat test-results/unit.tap; exit 1; }
echo "Unit: $(grep -c '^ok ' test-results/unit.tap) passed"
- name: Integration tests
run: |
bats tests/integration/ --tap > test-results/integration.tap 2>&1 || { cat test-results/integration.tap; exit 1; }
echo "Integration: $(grep -c '^ok ' test-results/integration.tap) passed"
- name: Security tests
run: |
bats tests/security/ --tap > test-results/security.tap 2>&1 || { cat test-results/security.tap; exit 1; }
echo "Security: $(grep -c '^ok ' test-results/security.tap) passed"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v6
with:
name: release-test-results
path: test-results/
retention-days: 90
build-release:
name: Build & Release
needs: verify-and-test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Build all release packages
run: make release
- name: Verify checksums
run: cd dist && sha256sum -c SHA256SUMS.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.tar.gz
dist/SHA256SUMS.txt
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
body: |
## Release Assets
| Package | Description |
|:--------|:------------|
| `apotropaios-${{ github.ref_name }}.tar.gz` | Runtime — lib, conf, docs, community files |
| `apotropaios-${{ github.ref_name }}-full.tar.gz` | Developer — adds tests, CI workflows, tasks |
| `apotropaios-${{ github.ref_name }}-venv.tar.gz` | Portable venv — adds activate.sh and bin/ wrapper |
| `SHA256SUMS.txt` | SHA-256 checksums for all packages |
## Installation
**Standard install:**
```bash
tar -xzf apotropaios-${{ github.ref_name }}.tar.gz
cd apotropaios-*/
sudo make install
```
**Virtual environment (no system install):**
```bash
tar -xzf apotropaios-${{ github.ref_name }}-venv.tar.gz
cd apotropaios-*-venv/
source activate.sh
sudo apotropaios detect
```
**Verify download integrity:**
```bash
sha256sum -c SHA256SUMS.txt
```
See [SETUP_GUIDE.md](docs/SETUP_GUIDE.md) for detailed instructions.