ci(linux): wip for aur and snap [skip ci]
This commit is contained in:
parent
9c56656f21
commit
9eab456963
7 changed files with 127 additions and 174 deletions
67
.github/workflows/insider-linux.yml
vendored
67
.github/workflows/insider-linux.yml
vendored
|
@ -99,6 +99,8 @@ jobs:
|
||||||
run: ./get_repo.sh
|
run: ./get_repo.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
SHOULD_BUILD_REH: 'no'
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
||||||
- name: Compress vscode artifact
|
- name: Compress vscode artifact
|
||||||
|
@ -289,7 +291,7 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- package_name: vscodium-insiders-bin
|
- package_name: vscodium-insiders-bin
|
||||||
- package_name: vscodium-insiders
|
- package_name: vscodium-insiders
|
||||||
if: needs.check.outputs.SHOULD_DEPLOY == 'yes'
|
if: needs.check.outputs.SHOULD_DEPLOY == 'yes' && github.event.inputs.generate_assets != 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Get version
|
- name: Get version
|
||||||
|
@ -305,66 +307,3 @@ jobs:
|
||||||
aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
|
aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
|
||||||
aur_username: ${{ secrets.AUR_USERNAME }}
|
aur_username: ${{ secrets.AUR_USERNAME }}
|
||||||
aur_email: ${{ secrets.AUR_EMAIL }}
|
aur_email: ${{ secrets.AUR_EMAIL }}
|
||||||
|
|
||||||
snap:
|
|
||||||
needs:
|
|
||||||
- check
|
|
||||||
- build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform:
|
|
||||||
- amd64
|
|
||||||
- arm64
|
|
||||||
# if: needs.check.outputs.SHOULD_DEPLOY == 'yes'
|
|
||||||
if: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: ${{ env.GITHUB_BRANCH }}
|
|
||||||
|
|
||||||
- name: Check version
|
|
||||||
env:
|
|
||||||
ARCHITECTURE: ${{ matrix.platform }}
|
|
||||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
|
||||||
run: ./stores/snapcraft/check_version.sh
|
|
||||||
|
|
||||||
- uses: docker/setup-qemu-action@v3
|
|
||||||
if: env.SHOULD_BUILD == 'yes'
|
|
||||||
|
|
||||||
- name: Prepare snapcraft.yaml
|
|
||||||
env:
|
|
||||||
ARCHITECTURE: ${{ matrix.platform }}
|
|
||||||
run: ./stores/snapcraft/build.sh
|
|
||||||
if: env.SHOULD_BUILD == 'yes'
|
|
||||||
|
|
||||||
# - uses: diddlesnaps/snapcraft-multiarch-action@v1
|
|
||||||
# with:
|
|
||||||
# path: stores/snapcraft/build
|
|
||||||
# architecture: ${{ matrix.platform }}
|
|
||||||
# id: build
|
|
||||||
# if: env.SHOULD_BUILD == 'yes'
|
|
||||||
|
|
||||||
- uses: snapcore/action-build@v1
|
|
||||||
with:
|
|
||||||
path: stores/snapcraft/build
|
|
||||||
id: build
|
|
||||||
if: env.SHOULD_BUILD == 'yes'
|
|
||||||
|
|
||||||
# - uses: diddlesnaps/snapcraft-review-action@v1
|
|
||||||
# with:
|
|
||||||
# snap: ${{ steps.build.outputs.snap }}
|
|
||||||
# isClassic: 'true'
|
|
||||||
# if: env.SHOULD_BUILD == 'yes'
|
|
||||||
|
|
||||||
- uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
|
||||||
repo_name: ${{ env.ASSETS_REPOSITORY }}
|
|
||||||
repo_token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
|
|
||||||
file: ${{ steps.build.outputs.snap }}
|
|
||||||
tag: ${{ env.RELEASE_VERSION }}
|
|
||||||
if: env.SHOULD_DEPLOY_TO_RELEASE == 'yes'
|
|
||||||
|
|
20
.github/workflows/stable-linux.yml
vendored
20
.github/workflows/stable-linux.yml
vendored
|
@ -103,6 +103,8 @@ jobs:
|
||||||
run: ./get_repo.sh
|
run: ./get_repo.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
SHOULD_BUILD_REH: 'no'
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
|
||||||
- name: Compress vscode artifact
|
- name: Compress vscode artifact
|
||||||
|
@ -320,8 +322,7 @@ jobs:
|
||||||
platform:
|
platform:
|
||||||
- amd64
|
- amd64
|
||||||
- arm64
|
- arm64
|
||||||
# if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
|
if: needs.build.outputs.SHOULD_DEPLOY == 'yes' && github.event.inputs.generate_assets != 'true'
|
||||||
if: false
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -329,16 +330,11 @@ jobs:
|
||||||
- name: Check version
|
- name: Check version
|
||||||
env:
|
env:
|
||||||
ARCHITECTURE: ${{ matrix.platform }}
|
ARCHITECTURE: ${{ matrix.platform }}
|
||||||
|
GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
|
||||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||||
run: ./stores/snapcraft/check_version.sh
|
run: ./stores/snapcraft/check_version.sh
|
||||||
|
|
||||||
- uses: docker/setup-qemu-action@v3
|
- uses: docker/setup-qemu-action@v3
|
||||||
if: env.SHOULD_DEPLOY == 'yes'
|
|
||||||
|
|
||||||
- name: Prepare snapcraft.yaml
|
|
||||||
env:
|
|
||||||
ARCHITECTURE: ${{ matrix.platform }}
|
|
||||||
run: ./stores/snapcraft/build.sh
|
|
||||||
if: env.SHOULD_BUILD == 'yes'
|
if: env.SHOULD_BUILD == 'yes'
|
||||||
|
|
||||||
- uses: diddlesnaps/snapcraft-multiarch-action@v1
|
- uses: diddlesnaps/snapcraft-multiarch-action@v1
|
||||||
|
@ -370,6 +366,14 @@ jobs:
|
||||||
release: stable
|
release: stable
|
||||||
if: env.SHOULD_DEPLOY_TO_STORE == 'yes'
|
if: env.SHOULD_DEPLOY_TO_STORE == 'yes'
|
||||||
|
|
||||||
|
- name: Upload assets
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: snap-${{ matrix.platform }}
|
||||||
|
path: ${{ steps.build.outputs.snap }}
|
||||||
|
retention-days: 3
|
||||||
|
if: github.event.inputs.generate_assets == 'true'
|
||||||
|
|
||||||
deb-rpm-repo-hook:
|
deb-rpm-repo-hook:
|
||||||
needs:
|
needs:
|
||||||
- check
|
- check
|
||||||
|
|
4
build.sh
4
build.sh
|
@ -38,12 +38,10 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then
|
||||||
VSCODE_PLATFORM="win32"
|
VSCODE_PLATFORM="win32"
|
||||||
else # linux
|
else # linux
|
||||||
# in CI, packaging will be done by a different job
|
# in CI, packaging will be done by a different job
|
||||||
if [[ "${CI_BUILD}" != "no" ]]; then
|
if [[ "${CI_BUILD}" == "no" ]]; then
|
||||||
yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
|
yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
|
||||||
|
|
||||||
find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
|
find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
|
||||||
|
|
||||||
SHOULD_BUILD_REH="no"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VSCODE_PLATFORM="linux"
|
VSCODE_PLATFORM="linux"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2129
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -6,15 +7,18 @@ export SHOULD_BUILD="no"
|
||||||
export SHOULD_DEPLOY_TO_RELEASE="no"
|
export SHOULD_DEPLOY_TO_RELEASE="no"
|
||||||
export SHOULD_DEPLOY_TO_STORE="no"
|
export SHOULD_DEPLOY_TO_STORE="no"
|
||||||
|
|
||||||
wget --quiet "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases" -O gh_latest.json
|
if [[ "${GENERATE_ASSETS}" == "true" ]]; then
|
||||||
SNAP_URL=$( jq -r 'map(select(.tag_name == "'"${RELEASE_VERSION}"'"))|first.assets[].browser_download_url|select(endswith("'"_${ARCHITECTURE}.snap"'"))' gh_latest.json )
|
export SHOULD_BUILD="yes"
|
||||||
|
else
|
||||||
|
wget --quiet "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases" -O gh_latest.json
|
||||||
|
SNAP_URL=$( jq -r 'map(select(.tag_name == "'"${RELEASE_VERSION}"'"))|first.assets[].browser_download_url|select(endswith("'"_${ARCHITECTURE}.snap"'"))' gh_latest.json )
|
||||||
|
|
||||||
if [[ -z "${SNAP_URL}" ]]; then
|
if [[ -z "${SNAP_URL}" ]]; then
|
||||||
export SHOULD_BUILD="yes"
|
export SHOULD_BUILD="yes"
|
||||||
export SHOULD_DEPLOY_TO_RELEASE="yes"
|
export SHOULD_DEPLOY_TO_RELEASE="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${VSCODE_QUALITY}" == "stable" ]]; then
|
if [[ "${VSCODE_QUALITY}" == "stable" ]]; then
|
||||||
sudo snap install --channel stable --classic snapcraft
|
sudo snap install --channel stable --classic snapcraft
|
||||||
|
|
||||||
echo "Architecture: ${ARCHITECTURE}"
|
echo "Architecture: ${ARCHITECTURE}"
|
||||||
|
@ -29,6 +33,7 @@ if [[ "${VSCODE_QUALITY}" == "stable" ]]; then
|
||||||
snap version
|
snap version
|
||||||
snap info "${SNAP_NAME}" || true
|
snap info "${SNAP_NAME}" || true
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${GITHUB_ENV}" ]]; then
|
if [[ "${GITHUB_ENV}" ]]; then
|
||||||
|
|
88
stores/snapcraft/stable/snap/snapcraft.yaml
Normal file
88
stores/snapcraft/stable/snap/snapcraft.yaml
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
name: codium
|
||||||
|
adopt-info: codium
|
||||||
|
summary: Code editing. Redefined.
|
||||||
|
description: |
|
||||||
|
Binary releases of Code without branding/telemetry/licensing
|
||||||
|
|
||||||
|
base: core20
|
||||||
|
grade: stable
|
||||||
|
confinement: classic
|
||||||
|
compression: lzo
|
||||||
|
|
||||||
|
parts:
|
||||||
|
codium:
|
||||||
|
plugin: nil
|
||||||
|
override-build: |
|
||||||
|
set -eu
|
||||||
|
ARCHITECTURE=$(dpkg --print-architecture)
|
||||||
|
# Get GitHub releases
|
||||||
|
wget --quiet https://api.github.com/repos/VSCodium/vscodium/releases -O latest.json
|
||||||
|
VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' latest.json)
|
||||||
|
DEB_URL=$(jq -r 'map(select(.tag_name == "'"$VERSION"'"))|first.assets[].browser_download_url|select(endswith("'"_$ARCHITECTURE.deb"'"))' latest.json)
|
||||||
|
DEB=$(basename "${DEB_URL}")
|
||||||
|
# Downloading .deb"
|
||||||
|
wget "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}"
|
||||||
|
# Unpacking .deb"
|
||||||
|
dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL}
|
||||||
|
rm -f latest.json
|
||||||
|
rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}"
|
||||||
|
# Set version
|
||||||
|
snapcraftctl set-version "$VERSION"
|
||||||
|
# Correct path to icon.
|
||||||
|
sed -i 's|Icon=vscodium|Icon=${SNAP}/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop
|
||||||
|
sed -i 's|Exec=/usr/share/codium/codium|Exec=codium|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop
|
||||||
|
sed -i 's|Icon=vscodium|Icon=/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium-url-handler.desktop
|
||||||
|
build-packages:
|
||||||
|
- wget
|
||||||
|
- jq
|
||||||
|
stage-packages:
|
||||||
|
- ca-certificates
|
||||||
|
- libasound2
|
||||||
|
- libatk-bridge2.0-0
|
||||||
|
- libatk1.0-0
|
||||||
|
- libatspi2.0-0
|
||||||
|
- libcairo2
|
||||||
|
- libcanberra-gtk3-module
|
||||||
|
- libcurl3-gnutls
|
||||||
|
- libcurl3-nss
|
||||||
|
- libcurl4
|
||||||
|
- libdrm2
|
||||||
|
- libgbm1
|
||||||
|
- libgl1
|
||||||
|
- libglib2.0-0
|
||||||
|
- libgtk-3-0
|
||||||
|
- libibus-1.0-5
|
||||||
|
- libnss3
|
||||||
|
- libpango-1.0-0
|
||||||
|
- libsecret-1-0
|
||||||
|
- libxcomposite1
|
||||||
|
- libxdamage1
|
||||||
|
- libxfixes3
|
||||||
|
- libxkbcommon0
|
||||||
|
- libxkbfile1
|
||||||
|
- libxrandr2
|
||||||
|
- libxss1
|
||||||
|
- locales-all
|
||||||
|
- packagekit-gtk3-module
|
||||||
|
- xdg-utils
|
||||||
|
prime:
|
||||||
|
- -usr/share/doc
|
||||||
|
- -usr/share/fonts
|
||||||
|
- -usr/share/icons
|
||||||
|
- -usr/share/lintian
|
||||||
|
- -usr/share/man
|
||||||
|
- -usr/share/codium/chrome-sandbox
|
||||||
|
|
||||||
|
electron-launch:
|
||||||
|
after:
|
||||||
|
- codium
|
||||||
|
plugin: dump
|
||||||
|
source: snap/local
|
||||||
|
|
||||||
|
apps:
|
||||||
|
codium:
|
||||||
|
command: electron-launch $SNAP/snap/usr/share/codium/bin/codium --no-sandbox
|
||||||
|
common-id: codium.desktop
|
||||||
|
|
||||||
|
url-handler:
|
||||||
|
command: electron-launch $SNAP/snap/usr/share/codium/bin/codium --open-url --no-sandbox
|
|
@ -1,81 +0,0 @@
|
||||||
name: @@SNAP_NAME@@
|
|
||||||
version: '@@SNAP_VERSION@@'
|
|
||||||
summary: Code editing. Redefined.
|
|
||||||
description: |
|
|
||||||
Binary releases of Visual Studio Code without branding/telemetry/licensing
|
|
||||||
|
|
||||||
base: core20
|
|
||||||
grade: stable
|
|
||||||
confinement: classic
|
|
||||||
compression: lzo
|
|
||||||
|
|
||||||
parts:
|
|
||||||
@@SNAP_NAME@@:
|
|
||||||
plugin: dump
|
|
||||||
source: .
|
|
||||||
stage-packages:
|
|
||||||
- ca-certificates
|
|
||||||
- libasound2
|
|
||||||
- libatk-bridge2.0-0
|
|
||||||
- libatk1.0-0
|
|
||||||
- libatspi2.0-0
|
|
||||||
- libcairo2
|
|
||||||
- libcanberra-gtk3-module
|
|
||||||
- libcurl3-gnutls
|
|
||||||
- libcurl3-nss
|
|
||||||
- libcurl4
|
|
||||||
- libdrm2
|
|
||||||
- libgbm1
|
|
||||||
- libgl1
|
|
||||||
- libglib2.0-0
|
|
||||||
- libgtk-3-0
|
|
||||||
- libibus-1.0-5
|
|
||||||
- libnss3
|
|
||||||
- libpango-1.0-0
|
|
||||||
- libsecret-1-0
|
|
||||||
- libxcomposite1
|
|
||||||
- libxdamage1
|
|
||||||
- libxfixes3
|
|
||||||
- libxkbcommon0
|
|
||||||
- libxkbfile1
|
|
||||||
- libxrandr2
|
|
||||||
- libxss1
|
|
||||||
- locales-all
|
|
||||||
- packagekit-gtk3-module
|
|
||||||
- xdg-utils
|
|
||||||
prime:
|
|
||||||
- -usr/share/doc
|
|
||||||
- -usr/share/fonts
|
|
||||||
- -usr/share/icons
|
|
||||||
- -usr/share/lintian
|
|
||||||
- -usr/share/man
|
|
||||||
build-attributes:
|
|
||||||
- enable-patchelf
|
|
||||||
build-packages:
|
|
||||||
- patchelf
|
|
||||||
override-build: |
|
|
||||||
snapcraftctl build
|
|
||||||
patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/x86_64-linux-gnu:$ORIGIN:/snap/core20/current/lib/x86_64-linux-gnu' $SNAPCRAFT_PART_INSTALL/snap/usr/share/@@SNAP_NAME@@/chrome_crashpad_handler
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
after:
|
|
||||||
- @@SNAP_NAME@@
|
|
||||||
plugin: nil
|
|
||||||
build-snaps:
|
|
||||||
- core20
|
|
||||||
build-packages:
|
|
||||||
- patchelf
|
|
||||||
override-prime: |
|
|
||||||
set -eux
|
|
||||||
for snap in "core20"; do
|
|
||||||
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
|
|
||||||
done
|
|
||||||
patchelf --print-rpath $SNAPCRAFT_PRIME/snap/usr/share/@@SNAP_NAME@@/chrome_crashpad_handler
|
|
||||||
|
|
||||||
apps:
|
|
||||||
@@SNAP_NAME@@:
|
|
||||||
command: electron-launch $SNAP/snap/usr/share/@@SNAP_NAME@@/bin/@@SNAP_NAME@@ --no-sandbox
|
|
||||||
common-id: @@SNAP_NAME@@.desktop
|
|
||||||
|
|
||||||
url-handler:
|
|
||||||
command: electron-launch $SNAP/snap/usr/share/@@SNAP_NAME@@/bin/@@SNAP_NAME@@ --open-url --no-sandbox
|
|
Loading…
Reference in a new issue