Skip to content

Commit 688ef22

Browse files
Merge pull request #85 from LizardByte/nightly
v0.1.0
2 parents 024743f + 9cf726b commit 688ef22

23 files changed

+845
-314
lines changed

.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
filename =
3+
*.py
4+
max-line-length = 120
5+
extend-exclude =
6+
venv/

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.

.github/label-actions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.

.github/workflows/CI.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: CI
23

34
on:
@@ -13,21 +14,21 @@ jobs:
1314
name: Check Changelog
1415
runs-on: ubuntu-latest
1516
steps:
16-
- name: Checkout
17-
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
18-
uses: actions/checkout@v3
17+
- name: Checkout
18+
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
19+
uses: actions/checkout@v3
1920

20-
- name: Verify Changelog
21-
id: verify_changelog
22-
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
23-
# base_ref for pull request check, ref for push
24-
uses: LizardByte/.github/actions/verify_changelog@master
25-
with:
26-
token: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Verify Changelog
22+
id: verify_changelog
23+
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
24+
# base_ref for pull request check, ref for push
25+
uses: LizardByte/.github/actions/verify_changelog@master
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
2728
outputs:
2829
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
2930
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
30-
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
31+
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
3132

3233
create_release:
3334
runs-on: ubuntu-latest

.github/workflows/auto-create-pr.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
45

56
name: Auto create PR
67

78
on:
8-
pull_request:
9-
types:
10-
- closed
9+
push:
1110
branches:
1211
- 'nightly'
1312

1413
jobs:
1514
create_pr:
16-
if: github.event.pull_request.merged == true
1715
runs-on: ubuntu-latest
1816

1917
steps:
@@ -25,7 +23,7 @@ jobs:
2523
with:
2624
source_branch: "" # should be "nightly" as it's the triggering branch
2725
destination_branch: "master"
28-
pr_title: "Pulling ${{ github.ref }} into master"
26+
pr_title: "Pulling ${{ github.ref_name }} into master"
2927
pr_template: ".github/pr_release_template.md"
3028
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
3129
pr_draft: true

.github/workflows/automerge.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
@@ -17,22 +18,22 @@ jobs:
1718
contains(fromJson('["LizardByte-bot"]'), github.actor)
1819
runs-on: ubuntu-latest
1920
steps:
20-
- name: Autoapproving
21-
uses: hmarr/auto-approve-action@v2
22-
with:
23-
github-token: "${{ secrets.GITHUB_TOKEN }}"
21+
- name: Autoapproving
22+
uses: hmarr/auto-approve-action@v2
23+
with:
24+
github-token: "${{ secrets.GITHUB_TOKEN }}"
2425

25-
- name: Label autoapproved
26-
uses: actions/github-script@v5
27-
with:
28-
github-token: ${{ secrets.GH_BOT_TOKEN }}
29-
script: |
30-
github.rest.issues.addLabels({
31-
issue_number: context.issue.number,
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
labels: ['autoapproved', 'autoupdate']
35-
})
26+
- name: Label autoapproved
27+
uses: actions/github-script@v6
28+
with:
29+
github-token: ${{ secrets.GH_BOT_TOKEN }}
30+
script: |
31+
github.rest.issues.addLabels({
32+
issue_number: context.issue.number,
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
labels: ['autoapproved', 'autoupdate']
36+
})
3637
3738
automerge:
3839
needs: [autoapprove]

.github/workflows/autoupdate.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# This workflow is designed to work with:
7+
# - automerge workflows
8+
9+
# It uses GitHub Action that auto-updates pull requests branches, when changes are pushed to their destination branch.
10+
# Auto-updating to the latest destination branch works only in the context of upstream repo and not forks.
11+
12+
name: autoupdate
13+
14+
on:
15+
push:
16+
branches:
17+
- 'nightly'
18+
19+
jobs:
20+
autoupdate-for-bot:
21+
name: Autoupdate autoapproved PR created in the upstream
22+
if: startsWith(github.repository, 'LizardByte/')
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Update
26+
uses: docker://chinthakagodawita/autoupdate-action:v1
27+
env:
28+
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
29+
PR_FILTER: "labelled"
30+
PR_LABELS: "autoupdate"
31+
PR_READY_STATE: "ready_for_review"
32+
MERGE_CONFLICT_ACTION: "ignore"

.github/workflows/ci-docker.yml

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
@@ -13,30 +14,56 @@ on:
1314
workflow_dispatch:
1415

1516
jobs:
17+
check_dockerfile:
18+
name: Check Dockerfile
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Check
25+
id: check
26+
run: |
27+
if [ -f "./Dockerfile" ]
28+
then
29+
FOUND=true
30+
else
31+
FOUND=false
32+
fi
33+
34+
echo "::set-output name=dockerfile::${FOUND}"
35+
36+
outputs:
37+
dockerfile: ${{ steps.check.outputs.dockerfile }}
38+
1639
check_changelog:
1740
name: Check Changelog
41+
needs: [check_dockerfile]
42+
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
1843
runs-on: ubuntu-latest
1944
steps:
20-
- name: Checkout
21-
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
22-
uses: actions/checkout@v3
23-
24-
- name: Verify Changelog
25-
id: verify_changelog
26-
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
27-
# base_ref for pull request check, ref for push
28-
uses: LizardByte/.github/actions/verify_changelog@master
29-
with:
30-
token: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Checkout
46+
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
47+
uses: actions/checkout@v3
48+
49+
- name: Verify Changelog
50+
id: verify_changelog
51+
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
52+
# base_ref for pull request check, ref for push
53+
uses: LizardByte/.github/actions/verify_changelog@master
54+
with:
55+
token: ${{ secrets.GITHUB_TOKEN }}
3156
outputs:
3257
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
3358

3459
docker:
60+
name: Docker
61+
needs: [check_dockerfile, check_changelog]
62+
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
3563
runs-on: ubuntu-latest
3664
permissions:
3765
packages: write
3866
contents: write
39-
needs: [check_changelog]
4067

4168
steps:
4269
- name: Checkout
@@ -49,13 +76,13 @@ jobs:
4976
run: |
5077
# get branch name
5178
BRANCH=${GITHUB_HEAD_REF}
52-
79+
5380
if [ -z "$BRANCH" ]
5481
then
5582
echo "This is a PUSH event"
5683
BRANCH=${{ github.ref_name }}
5784
fi
58-
85+
5986
# determine to push image to dockerhub and ghcr or not
6087
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
6188
PUSH=true
@@ -67,7 +94,7 @@ jobs:
6794
REPOSITORY=${{ github.repository }}
6895
BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]')
6996
COMMIT=${{ github.sha }}
70-
97+
7198
TAGS="${BASE_TAG}:${COMMIT:0:7},ghcr.io/${BASE_TAG}:${COMMIT:0:7}"
7299
73100
if [[ $GITHUB_REF == refs/heads/master ]]; then
@@ -82,7 +109,7 @@ jobs:
82109
if [[ ${NEXT_VERSION} != "" ]]; then
83110
TAGS="${TAGS},${BASE_TAG}:${NEXT_VERSION},ghcr.io/${BASE_TAG}:${NEXT_VERSION}"
84111
fi
85-
112+
86113
# read the platforms from `.docker_platforms`
87114
PLATFORMS=$(<.docker_platforms)
88115
@@ -94,10 +121,10 @@ jobs:
94121
echo ::set-output name=tags::${TAGS}
95122
96123
- name: Set Up QEMU
97-
uses: docker/setup-qemu-action@v1
124+
uses: docker/setup-qemu-action@v2
98125

99126
- name: Set up Docker Buildx
100-
uses: docker/setup-buildx-action@v1
127+
uses: docker/setup-buildx-action@v2
101128
id: buildx
102129

103130
- name: Cache Docker Layers
@@ -110,21 +137,21 @@ jobs:
110137
111138
- name: Log in to Docker Hub
112139
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
113-
uses: docker/login-action@v1
140+
uses: docker/login-action@v2
114141
with:
115142
username: ${{ secrets.DOCKER_HUB_USERNAME }}
116143
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
117144

118145
- name: Log in to the Container registry
119146
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
120-
uses: docker/login-action@v1
147+
uses: docker/login-action@v2
121148
with:
122149
registry: ghcr.io
123150
username: ${{ secrets.GH_BOT_NAME }}
124151
password: ${{ secrets.GH_BOT_TOKEN }}
125152

126153
- name: Build and push
127-
uses: docker/build-push-action@v2
154+
uses: docker/build-push-action@v3
128155
with:
129156
context: ./
130157
file: ./Dockerfile

.github/workflows/issues-stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.

.github/workflows/issues.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
@@ -8,7 +9,7 @@ on:
89
issues:
910
types: [labeled, unlabeled]
1011
discussion:
11-
types: [ labeled, unlabeled ]
12+
types: [labeled, unlabeled]
1213

1314
jobs:
1415
label:

0 commit comments

Comments
 (0)