update cli to 3.21.0-beta.14 part 2 #295
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dev Release Windoze Installer | |
on: | |
push: | |
branches: | |
- main | |
- 'preview/**' | |
jobs: | |
dev-release-windows-installer: | |
runs-on: ${{ matrix.os }} | |
env: | |
WINDOZE_CERT_DATA: ${{ secrets.WINDOZE_CERT_DATA }} | |
WINDOZE_CERT_PASSWORD: ${{ secrets.WINDOZE_CERT_PASSWORD }} | |
TERM: xterm | |
strategy: | |
matrix: | |
os: | |
- windows-2022 | |
node-version: | |
- '18' | |
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 | |
shell: bash | |
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 | |
shell: bash | |
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 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 | |
shell: bash | |
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@v3 | |
with: | |
version: dev | |
sync: false | |
- name: Ensure version | |
run: node -pe 'JSON.parse(process.argv[1]).version' "$(cat package.json)" | |
shell: bash | |
- name: Import and verify certs | |
shell: powershell | |
run: scripts/import-win-certs.ps1 | |
- name: Assemble pieces | |
shell: powershell | |
run: scripts/assemble-win.ps1 | |
- name: Create and sign package | |
shell: powershell | |
run: scripts/create-exe.ps1 | |
# 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 }} | |
shell: bash | |
run: | | |
# Create release directories | |
mkdir -p dist releases dev-builds | |
# Move from build dir to dist | |
cp -f "build/installer/dist/LandoInstaller.exe" "dist/LandoInstaller.exe" | |
# Snapshot release | |
cp -f "dist/LandoInstaller.exe" "dev-builds/lando-build-${{ github.sha }}-$ARCH.exe" | |
# Branch releases | |
if [ -z "$SOURCE_TAG" ]; then cp -f "dist/LandoInstaller.exe" "releases/lando-$ARCH-$SOURCE_BRANCH-latest.exe"; fi | |
# Latest dev release | |
if [[ "$SOURCE_BRANCH" == "main" ]]; then cp -f "dist/LandoInstaller.exe" "releases/lando-$ARCH-latest.exe"; fi | |
# Latest dev release 2 | |
if [[ "$SOURCE_BRANCH" == "main" ]]; then cp -f "dist/LandoInstaller.exe" "releases/lando-$ARCH-dev.exe"; 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}}.exe | |
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 | |
shell: bash | |
run: | | |
aws s3 sync releases s3://files.lando.dev/installer | |
# Below is for backwards compatibility | |
aws s3 sync releases s3://files.lando.dev |