-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (134 loc) · 5.02 KB
/
nightly.yml
File metadata and controls
141 lines (134 loc) · 5.02 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Nightly Build
on:
schedule:
- cron: '0 0 * * 1-5'
workflow_dispatch:
env:
python-version: 3.12
poetry-version: 1.5.0
jobs:
check-commit:
runs-on: ubuntu-latest
outputs:
alive: ${{ steps.check.outputs.alive || github.event_name == 'workflow_dispatch' }}
steps:
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
- name: Checkout latest repository commit
uses: actions/checkout@v4
with:
show-progress: false
- name: Get new commits
id: check
run: |
if [[ $(git log --oneline --since '24 hours ago' | wc -l) -gt 0 ]]; then
echo "alive=true" >> $GITHUB_ENV
else
echo "alive=false" >> $GITHUB_ENV
fi
build:
runs-on: ${{ matrix.os }}
needs: [check-commit]
if: ${{ needs.check-commit.outputs.alive == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- name: "Windows 64bit"
os: windows-latest
arch: x64
- name: "Linux 64bit"
os: ubuntu-latest
arch: x64
- name: "macOS 64bit"
os: macos-latest
arch: x64
steps:
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
- name: Checkout latest repository commit
uses: actions/checkout@v4
with:
show-progress: false
# Setup python virtual environment
- name: Install poetry
run: pipx install poetry==${{ env.poetry-version }}
- name: Setup Python ${{ env.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
cache: poetry
cache-dependency-path: poetry.lock
- name: Install python dev dependencies
run: pip3 install packaging --ignore-installed
# Setup Poetry virtual environment
- name: Use matrix python version in Poetry virtualenv
run: poetry env use $(python3 -c "import sys; print(sys.executable)")
- name: Setup Poetry plugins and project dependencies
run: poetry install -n
# Build pyinstaller binary
- name: Build pyinstaller binary
run: poetry pyinstaller
# Upload artifacts
- name: Rename Binaries
shell: bash
run: |
if [[ "$OSTYPE" == "msys" ]]; then
: #mv ocebuild.exe ocebuild.exe
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
mv ocebuild ocebuild.linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
: #mv ocebuild ocebuild
fi
working-directory: dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ocebuild-py${{ env.python-version }}-${{ matrix.os }}-${{ matrix.arch }}
path: dist/*
if-no-files-found: error
retention-days: 7
release:
runs-on: ubuntu-latest
needs: [check-commit, build]
if: ${{ needs.check-commit.outputs.alive == 'true' }}
permissions:
contents: write
steps:
- name: Download all platform artifacts
uses: actions/download-artifact@v4
with:
pattern: ocebuild-py${{ env.python-version }}-*
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: dist
- name: Set executable permissions
run: |
find dist -mindepth 2 -type f -exec mv -t dist {} + && \
find dist -type d -empty -delete && \
chmod +x dist/*
- name: Get metadata for the latest commit hash and branch name
shell: bash
run: |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
echo "version=$(curl -s https://raw.githubusercontent.com/Qonfused/OCE-Build/main/ci/registry/project.json | jq -r '.version')" >> "$GITHUB_ENV"
- name: Upload to Release
uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
name: Nightly Build (v${{ env.version }})
body: |
This release contains a nightly build of ocebuild v${{ env.version }} for Windows, Linux and macOS.
This build is automatically generated from the [latest commit](https://github.com/Qonfused/OCE-Build/commit/${{ env.sha_short }}) on the ${{ env.branch }} branch and is not guaranteed to be stable.
For information about changes present in this pre-release version, refer to the [CHANGELOG](https://github.com/Qonfused/OCE-Build/blob/main/CHANGELOG.md).
files: dist/ocebuild*
gzip: folders
prerelease: true
allow_override: true