-
Notifications
You must be signed in to change notification settings - Fork 40
90 lines (90 loc) · 2.97 KB
/
Copy pathrelease.yml
File metadata and controls
90 lines (90 loc) · 2.97 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
name: Release
on:
workflow_dispatch:
inputs:
ref:
description: Commit, branch or tag to release
default: main
required: true
permissions:
contents: read
concurrency:
group: release-${{ github.repository }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
container: archlinux:base-devel
timeout-minutes: 60
outputs:
tag: ${{ steps.version.outputs.tag }}
env:
CLAVIS_CI_CONTAINER: '1'
steps:
- name: Bootstrap disposable Arch container
run: pacman -Syu --needed --noconfirm git python sudo
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
persist-credentials: false
# Share workspace trust across root/builder and checkout HOME changes.
- name: Trust checked-out workspace
run: git config --system --add safe.directory "$GITHUB_WORKSPACE"
- name: Create the local release commit
id: version
run: |
version=$(python3 scripts/release.py next-version)
python3 scripts/release.py stamp "$version"
version_file=$(python3 -c 'import json; print(json.load(open("packaging/dependencies.json"))["versionFile"])')
git add -- "$version_file"
git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' commit --allow-empty -m "Release v$version"
git tag "v$version"
echo "tag=v$version" >> "$GITHUB_OUTPUT"
- name: Independent checks and package build
run: scripts/ci/arch.sh
- name: Export the tested release commit
env:
RELEASE_TAG: ${{ steps.version.outputs.tag }}
run: git bundle create .packaging/release.bundle "refs/tags/$RELEASE_TAG"
- uses: actions/upload-artifact@v4
with:
name: release
include-hidden-files: true
path: |
.packaging/release.bundle
.packaging/release/*.tar.gz
.packaging/release/*.whl
.packaging/release/PKGBUILD
.packaging/release/.SRCINFO
.packaging/release/*.install
.packaging/release/*.hook
.packaging/release/install-arch.sh
.packaging/release/SHA256SUMS
- name: Keep failed check logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: release-logs
path: |
/tmp/clavis-check.*/*.log
build/Testing/Temporary/LastTest.log
publish:
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: release
path: .packaging
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.build.outputs.tag }}
run: scripts/ci/publish.sh