Replace the packageManager pin and .mise.toml (pnpm 12.3.4, node 26) with mise.toml tracking pnpm latest; CI installs pnpm through mise instead of an unpinned npm -g, keeping node from the runner image.
111 lines
3.2 KiB
YAML
111 lines
3.2 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: archlinux
|
|
container:
|
|
image: node:25
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install mise
|
|
run: |
|
|
curl -fsSL https://mise.run | sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install pnpm and TypeScript
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
mise trust
|
|
mise install pnpm
|
|
mise reshim
|
|
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
|
|
npm install -g typescript@5.8.3
|
|
|
|
- name: Install just
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y libglib2.0-dev glib-networking zip
|
|
|
|
- name: Install project dependencies
|
|
run: pnpm install --ignore-scripts
|
|
|
|
- name: Run unit tests
|
|
run: just test
|
|
|
|
- name: Build and package extension
|
|
run: just build-package
|
|
|
|
- name: Upload extension package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: aerospike-extension
|
|
path: aerospike.zip
|
|
retention-days: 30
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: archlinux
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
environment:
|
|
name: production
|
|
container:
|
|
image: node:25
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: aerospike-extension
|
|
|
|
- name: Get version from package.json
|
|
id: get_version
|
|
run: |
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
echo "version=v${VERSION}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create Gitea Release
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
curl -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"tag_name": "${{ steps.get_version.outputs.version }}",
|
|
"name": "Release ${{ steps.get_version.outputs.version }}",
|
|
"body": "Automated release of aerospike GNOME extension ${{ steps.get_version.outputs.version }}\n\n## Installation\nDownload aerospike.zip and install it as a GNOME extension."
|
|
}' \
|
|
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases"
|
|
|
|
- name: Upload Release Asset
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
RELEASE_ID=$(curl -H "Authorization: token ${GITEA_TOKEN}" \
|
|
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.get_version.outputs.version }}" | \
|
|
grep -Po '"id":\s*\K[0-9]+' | head -1)
|
|
|
|
curl -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: multipart/form-data" \
|
|
-F "attachment=@aerospike.zip" \
|
|
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=aerospike.zip"
|