Skip to content

Commit 7a3ac7a

Browse files
committed
Draft.
1 parent 7a6026d commit 7a3ac7a

File tree

3 files changed

+271
-0
lines changed

3 files changed

+271
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
# Intended to designate a build (eg. of 'ubcp') as suitable for internal integration with a larger project (eg. 'ubdist') .
3+
# Before designating a new build internal, consider renaming an existing internal designated build to 'internal-YYYY-MM-DD' by the 'renameTag-build_to_internal' Github Actions workflow.
4+
# If compatible or successful as documented (eg. specific features tested) or expected (ie. all essential features tested), the next step would be to tag as 'certified' with a date.
5+
6+
7+
# ATTRIBUTION-AI - Largely attributable to ChatGPT GPT-4 2023-06-26 .
8+
9+
10+
name: _renameTag-build_to_internal
11+
12+
13+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
14+
permissions:
15+
actions: write
16+
checks: read
17+
contents: write
18+
deployments: read
19+
issues: read
20+
packages: read
21+
pull-requests: read
22+
repository-projects: read
23+
security-events: none
24+
statuses: read
25+
26+
27+
28+
on:
29+
workflow_dispatch:
30+
#inputs:
31+
#source_tag:
32+
#description: 'Source Tag'
33+
#required: true
34+
#target_tag:
35+
#description: 'Target Tag'
36+
#required: true
37+
38+
39+
jobs:
40+
copy-release:
41+
runs-on: ubuntu-latest
42+
steps:
43+
44+
45+
46+
- name: Checkout code
47+
uses: actions/checkout@v2
48+
with:
49+
fetch-depth: 0 # we need fetch-depth: 0 to fetch all tags
50+
51+
- name: Update release
52+
run: |
53+
_safeEcho ()
54+
{
55+
printf '%s' "$1";
56+
shift;
57+
[[ "$@" == "" ]] && return 0;
58+
local currentArg;
59+
for currentArg in "$@";
60+
do
61+
printf '%s' " ";
62+
printf '%s' "$currentArg";
63+
done;
64+
return 0
65+
}
66+
67+
68+
# Fetch all releases
69+
releases=$(gh api repos/${{ github.repository }}/releases)
70+
71+
72+
# Find the tag name for the release by its name
73+
tag_name=$(echo "$releases" | jq -r '.[] | select(.name == "internal") | .tag_name' | cat)
74+
75+
# Edit the release using its tag name
76+
if [[ "$tag_name" != "" ]]
77+
then
78+
gh release delete "$tag_name" --yes
79+
fi
80+
81+
82+
# Find the tag name for the release by its name
83+
tag_name=$(echo "$releases" | jq -r '.[] | select(.name == "build") | .tag_name')
84+
body=$(echo "$releases" | jq -r '.[] | select(.name == "build") | .body' | tr -dc 'a-zA-Z0-9.:\=\_\-/%+\ \n')
85+
86+
# Edit the release using its tag name
87+
_safeEcho "$body" | gh release edit "$tag_name" --title "internal" --notes -
88+
env:
89+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
# Intended to designate an build (eg. of 'ubcp')that was found of sufficient quality for internal inclusion with other projects as a historic example.
3+
# If compatible or successful as documented (eg. specific features tested) or expected (ie. all essential features tested), the next step would be to tag as 'certified' with a date.
4+
5+
6+
# ATTRIBUTION-AI - Largely attributable to ChatGPT GPT-4 2023-06-26 .
7+
8+
9+
10+
11+
name: _renameTag-internal_to_internal-date
12+
13+
14+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
15+
permissions:
16+
actions: write
17+
checks: read
18+
contents: write
19+
deployments: read
20+
issues: read
21+
packages: read
22+
pull-requests: read
23+
repository-projects: read
24+
security-events: none
25+
statuses: read
26+
27+
28+
29+
on:
30+
workflow_dispatch:
31+
#inputs:
32+
#source_tag:
33+
#description: 'Source Tag'
34+
#required: true
35+
#target_tag:
36+
#description: 'Target Tag'
37+
#required: true
38+
39+
40+
jobs:
41+
copy-release:
42+
runs-on: ubuntu-latest
43+
steps:
44+
45+
46+
47+
- name: Checkout code
48+
uses: actions/checkout@v2
49+
with:
50+
fetch-depth: 0 # we need fetch-depth: 0 to fetch all tags
51+
52+
- name: Update release
53+
run: |
54+
_safeEcho ()
55+
{
56+
printf '%s' "$1";
57+
shift;
58+
[[ "$@" == "" ]] && return 0;
59+
local currentArg;
60+
for currentArg in "$@";
61+
do
62+
printf '%s' " ";
63+
printf '%s' "$currentArg";
64+
done;
65+
return 0
66+
}
67+
68+
69+
# Fetch all releases
70+
releases=$(gh api repos/${{ github.repository }}/releases)
71+
72+
73+
# Find the tag name for the release by its name
74+
tag_name=$(echo "$releases" | jq -r ".[] | select(.name == \"internal-$(date +'%Y-%m-%d')\") | .tag_name" | cat)
75+
76+
# Edit the release using its tag name
77+
if [[ "$tag_name" != "" ]]
78+
then
79+
gh release delete "$tag_name" --yes
80+
fi
81+
82+
83+
# Find the tag name for the release by its name
84+
tag_name=$(echo "$releases" | jq -r '.[] | select(.name == "internal") | .tag_name')
85+
body=$(echo "$releases" | jq -r '.[] | select(.name == "internal") | .body' | tr -dc 'a-zA-Z0-9.:\=\_\-/%+\ \n')
86+
87+
# Edit the release using its tag name
88+
_safeEcho "$body" | gh release edit "$tag_name" --title "internal"-$(date +'%Y-%m-%d') --notes -
89+
env:
90+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
92+
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
3+
4+
5+
name: menuconfig_mainline
6+
on:
7+
workflow_dispatch:
8+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
9+
#schedule:
10+
#- cron: '5 1 * * 6'
11+
#- cron: '5 1 * * 2,4'
12+
#- cron: '5 1 * * 2'
13+
#- cron: '5 1 * * 4'
14+
15+
# https://docs.github.com/en/actions/using-jobs/using-concurrency
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
menuconfig_mainline:
22+
runs-on: ubuntu-latest
23+
#runs-on: ubuntu-20.04
24+
#runs-on: buildjet-2vcpu-ubuntu-2004
25+
#runs-on: buildjet-64vcpu-ubuntu-2004
26+
steps:
27+
- name: users
28+
shell: bash
29+
run: |
30+
sudo -u ubuntu -n bash -c 'sudo -n useradd runner --non-unique -u $UID -g $UID' || true
31+
sudo -u ubuntu -n bash -c 'sudo -n groupadd runner --non-unique -g $UID' || true
32+
sudo -u runner -n bash -c 'sudo -n echo $USER $UID' || true
33+
true
34+
# Apparently may increase buildJet 'runner' to 77GB (instead of 61GB).
35+
# Apparently may increase Github Actions 'runner' to 59GB (instead of 31GB) .
36+
- name: Maximize build space
37+
uses: easimon/maximize-build-space@master
38+
with:
39+
#root-reserve-mb: 512
40+
root-reserve-mb: 2048
41+
#temp-reserve-mb: 100
42+
temp-reserve-mb: 300
43+
#swap-size-mb: 128
44+
swap-size-mb: 192
45+
remove-dotnet: 'true'
46+
remove-android: 'true'
47+
remove-haskell: 'true'
48+
- uses: actions/checkout@v2
49+
- name: _getMinimal_cloud
50+
shell: bash
51+
run: |
52+
./ubiquitous_bash.sh _getMinimal_cloud
53+
timeout-minutes: 90
54+
- name: _fetchKernel_mainline
55+
shell: bash
56+
run: |
57+
export current_XZ_OPT_kernelSource="-2"
58+
./ubiquitous_bash.sh _fetchKernel-mainline
59+
timeout-minutes: 180
60+
#- name: Setup tmate session
61+
#uses: mxschmitt/action-tmate@v3
62+
## ssh -i <path-to-key> <tmate-connection-string>
63+
#with:
64+
#limit-access-to-actor: true
65+
#timeout-minutes: 320
66+
- name: Setup upterm session
67+
uses: lhotari/action-upterm@v1
68+
with:
69+
## limits ssh access and adds the ssh public key for the user which triggered the workflow
70+
limit-access-to-actor: true
71+
## limits ssh access and adds the ssh public keys of the listed GitHub users
72+
# DANGER: Discouraged. Prefer 'limit-access-to-actor' instead.
73+
#limit-access-to-users: githubuser1,githubuser2
74+
timeout-minutes: 320
75+
- name: artifacts
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: menuconfig
79+
path: |
80+
./_local/mainline/.config
81+
./_prog
82+
./_local/ops.sh
83+
timeout-minutes: 45
84+
85+
86+
87+
88+

0 commit comments

Comments
 (0)