v3.21.0-beta.12 #19
Workflow file for this run
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: Release Installer | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
release-windows-installer: | |
runs-on: windows-2022 | |
env: | |
WINDOZE_CERT_DATA: ${{ secrets.WINDOZE_CERT_DATA }} | |
WINDOZE_CERT_PASSWORD: ${{ secrets.WINDOZE_CERT_PASSWORD }} | |
TERM: xterm | |
strategy: | |
matrix: | |
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@v2 | |
with: | |
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" | |
# Tag releases | |
cp -f "dist/LandoInstaller.exe" "releases/lando-$ARCH-$SOURCE_TAG.exe" | |
# Latest stable release | |
if [ "${{ github.event.release.prerelease }}" == "false" ]; then | |
cp -f "dist/LandoInstaller.exe" "releases/lando-$ARCH-stable.exe" | |
else | |
cp -f "dist/LandoInstaller.exe" "releases/lando-$ARCH-edge.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 | |
# Upload releases to GitHub Releases | |
- name: Upload releases to GitHub Releases | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
files: releases/lando-${{ matrix.arch}}-${{ steps.vars.outputs.source-tag }}.exe | |
# @TODO: Handle autochangelog stuff here eventaully | |
# body_path: ${{ github.workflow }}-CHANGELOG.txt | |
# we run this again at the end and sync here so that we only sync when a build and deploy succeedes | |
bump: | |
runs-on: ${{ matrix.os }} | |
needs: | |
- release-windows-installer | |
env: | |
TERM: xterm | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
node-version: | |
- '18' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- 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 --production | |
- name: Prepare Release | |
uses: lando/prepare-release-action@v2 | |
- name: Ensure version | |
run: node -pe 'JSON.parse(process.argv[1]).version' "$(cat package.json)" | |
shell: bash |