Skip to content

Commit 61b7e1f

Browse files
CI: Add GitHub Actions
1 parent a519f97 commit 61b7e1f

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
run-name: CI
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
jobs:
7+
Build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
arch: [x64, arm64, armhf]
13+
container: almalinux:9
14+
steps:
15+
- name: Install git
16+
run: |
17+
yum install -y git
18+
- name: Check out repository code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 1
22+
submodules: recursive
23+
- name: Build
24+
run: |
25+
echo "prod_version=$(cat version.txt)" >> $GITHUB_ENV
26+
scripts/yum-install.sh
27+
make ARCH=${{ matrix.arch }}
28+
- name: Archive production artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: vscode-server_${{ env.prod_version }}_${{ matrix.arch }}
32+
path: ${{ github.workspace }}/dist/vscode-server_${{ env.prod_version }}_${{ matrix.arch }}.tar.gz

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
run-name: Release
3+
on:
4+
workflow_dispatch:
5+
jobs:
6+
Build:
7+
uses: ./.github/workflows/ci.yml
8+
Make-Release:
9+
permissions:
10+
contents: write
11+
runs-on: ubuntu-latest
12+
needs: Build
13+
steps:
14+
- name: Check out repository code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
submodules: recursive
19+
- name: Get product version
20+
run: |
21+
echo "prod_version=$(cat version.txt)" >> $GITHUB_ENV
22+
- name: Download Artifact
23+
uses: actions/download-artifact@v4
24+
with:
25+
path: ${{ github.workspace }}/dist
26+
- name: Reorganize files
27+
run: |
28+
mv dist/*/*.tar.gz dist/
29+
rm -rf dist/*/
30+
- name: Make a tag
31+
run: |
32+
git config --global user.name 'GitHub Actions'
33+
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
34+
git tag -a '${{ env.prod_version }}' -m '${{ env.prod_version }}'
35+
git push origin '${{ env.prod_version }}'
36+
- name: Make a release
37+
env:
38+
GITHUB_TOKEN: ${{ github.token }}
39+
run: |
40+
gh release create --title 'v${{ env.prod_version }}' --notes '' --verify-tag '${{ env.prod_version }}' dist/*.tar.gz

.github/workflows/update.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update
2+
run-name: Update
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 8 * * *"
7+
jobs:
8+
Check-Updates:
9+
permissions:
10+
issues: write
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 1
17+
submodules: recursive
18+
- name: Check updates
19+
env:
20+
GITHUB_TOKEN: ${{ github.token }}
21+
run: |
22+
set -eu
23+
title='[BOT] Update Dependencies'
24+
message=''
25+
26+
if [ "$(gh issue list --json 'id' --jq length --state 'open' --search "${title}")" != '0' ]; then
27+
echo 'Issue already exists, skipping...'
28+
exit 0
29+
fi
30+
31+
pushd ./libfastjson
32+
git fetch origin
33+
if [ $(git rev-parse --verify origin/master) != $(git rev-parse --verify HEAD) ]; then
34+
message="${message}- libfastjson is outdated"$'\n'
35+
fi
36+
popd
37+
38+
pushd ./libpatchelf/patchelf
39+
git fetch origin
40+
if [ $(git rev-parse --verify origin/master) != $(git rev-parse --verify HEAD) ]; then
41+
message="${message}- patchelf is outdated"$'\n'
42+
fi
43+
popd
44+
45+
scripts/update-deps.py
46+
if [ -n "$(git diff scripts/deps.sh)" ]; then
47+
message="${message}- \`scripts/deps.sh\` is outdated"$'\n'
48+
fi
49+
50+
if [ -n "${message}" ]; then
51+
owner="$(gh repo view --json 'owner' --jq '.owner.login')"
52+
gh issue create --assignee "${owner}" --title "${title}" --body "${message}"
53+
fi

0 commit comments

Comments
 (0)