Skip to content

Autoupdated submodule pointer #268

Autoupdated submodule pointer

Autoupdated submodule pointer #268

name: Dev Release Linux Installer
on:
push:
branches:
- main
- 'preview/**'
jobs:
dev-release-linux-installer:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
strategy:
matrix:
os:
- ubuntu-22.04
node-version:
- '18'
ruby-version:
- '2.6'
flavor:
- deb
- pacman
- rpm
arch:
- x64
steps:
# Install deps and cache
# Eventually it would be great if these steps could live in a separate YAML file
# that could be included in line to avoid code duplication
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set other variables
id: vars
run: |
# Set generic source ref vars
echo "source-name=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "source-branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "source-tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
# Unset vars if it makes sense to do so
if [ "$GITHUB_REF" == "${GITHUB_REF#refs/tags/}" ]; then
echo "source-tag=" >> $GITHUB_OUTPUT
fi
if [ "$GITHUB_REF" == "${GITHUB_REF#refs/heads/}" ]; then
echo "source-branch=" >> $GITHUB_OUTPUT
fi
- name: Test user defined variables
run: |
echo "The SOURCE_NAME is ${{ steps.vars.outputs.source-name }}"
echo "The SOURCE_BRANCH is ${{ steps.vars.outputs.source-branch }}"
echo "The SOURCE_TAG is ${{ steps.vars.outputs.source-tag }}"
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile
# Import ENVVARS from build.env
# @NOTE: We do this so there is a single place to update versions
- name: Import build version envvars
id: import-env
run: |
while read line; do
echo "$line" >> $GITHUB_ENV
done < BUILD.env
# Build and prep the release
- name: Prepare Release
uses: lando/prepare-release-action@v2
with:
version: dev
sync: false
- name: Ensure version
run: node -pe 'JSON.parse(process.argv[1]).version' "$(cat package.json)"
shell: bash
- name: Assemble pieces
run: scripts/assemble-linux.sh
- name: Create package
run: |
LANDO_VERSION=$(node -pe 'JSON.parse(process.argv[1]).version' "$(cat package.json)")
scripts/create-pkg.sh ${{ matrix.flavor }} "$LANDO_VERSION"
# Create and upload releases
- name: Create releases
env:
SOURCE_BRANCH: ${{ steps.vars.outputs.source-branch }}
SOURCE_TAG: ${{ steps.vars.outputs.source-tag }}
ARCH: ${{ matrix.arch }}
run: |
# Create release directories
mkdir -p releases dev-builds
# Snapshot release
cp -f "dist/lando.${{ matrix.flavor }}" "dev-builds/lando-build-${{ github.sha }}-$ARCH.${{ matrix.flavor }}"
# Branch releases
if [ -z "$SOURCE_TAG" ]; then cp -f "dist/lando.${{ matrix.flavor }}" "releases/lando-$ARCH-$SOURCE_BRANCH-latest.${{ matrix.flavor }}"; fi
# Latest dev release
if [[ "$SOURCE_BRANCH" == "main" ]]; then cp -f "dist/lando.${{ matrix.flavor }}" "releases/lando-$ARCH-latest.${{ matrix.flavor }}"; fi
# Latest dev release 2
if [[ "$SOURCE_BRANCH" == "main" ]]; then cp -f "dist/lando.${{ matrix.flavor }}" "releases/lando-$ARCH-dev.${{ matrix.flavor }}"; fi
# Print what we end up with
ls -lsa releases
ls -lsa dev-builds
# Upload back to Actions
- name: Upload build snapshot as Actions artifact
uses: actions/upload-artifact@v3
with:
name: lando-build-${{ github.sha }}-${{ matrix.arch}}.${{ matrix.flavor }}
path: dev-builds/
if-no-files-found: error
retention-days: 30
# Upload releases to S3
- name: Configure S3 Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload releases to S3
run: |
aws s3 sync releases s3://files.lando.dev/installer
# Below is for backwards compatibility
aws s3 sync releases s3://files.lando.dev