Repository navigation
70 lines (66 loc) · 2.39 KB
/
Copy pathvalidate.yml
File metadata and controls
70 lines (66 loc) · 2.39 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
name: Validate and Release Plugin
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Validate package layout and Python sources
run: python .infernux-dev/validate.py
- name: Check validation contracts
run: python -m unittest discover -s tests
- name: Build and verify deterministic package bytes
run: |
mkdir -p dist/repro
python package.py build dist/plugin.inxpkg
python package.py verify dist/plugin.inxpkg
python package.py build dist/repro/plugin.inxpkg
cmp dist/plugin.inxpkg dist/repro/plugin.inxpkg
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: validate
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Name the release artifact from the package reference
run: |
PACKAGE_NAME="$(python -c 'import json; print(json.load(open("package/inx_package.json"))["reference"].replace("/", ".") + ".inxpkg")')"
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> "${GITHUB_ENV}"
- name: Build and verify a reproducible package
run: |
mkdir -p dist/repro
python package.py build "dist/${PACKAGE_NAME}"
python package.py verify "dist/${PACKAGE_NAME}"
python package.py build "dist/repro/${PACKAGE_NAME}"
cmp "dist/${PACKAGE_NAME}" "dist/repro/${PACKAGE_NAME}"
rm -rf dist/repro
- name: Generate the Infernux release manifest
run: >-
python package.py release-manifest "dist/${PACKAGE_NAME}"
--tag "${GITHUB_REF_NAME}"
--output dist/infernux-plugin-release.json
- name: Publish GitHub Release assets
env:
GH_TOKEN: ${{ github.token }}
run: |
# Published reference/version pairs are immutable. A duplicate tag
# must fail instead of replacing users' installed archive baseline.
gh release create "${GITHUB_REF_NAME}" "dist/${PACKAGE_NAME}" dist/infernux-plugin-release.json \
--verify-tag --generate-notes