Skip to content

switched set-output and save-state to new GITHUB_OUTPUT and GITHUB_ST… #77

switched set-output and save-state to new GITHUB_OUTPUT and GITHUB_ST…

switched set-output and save-state to new GITHUB_OUTPUT and GITHUB_ST… #77

Workflow file for this run

name: Create Dev Releases
on:
push:
branches:
- main
- 'preview/**'
jobs:
package:
runs-on: ubuntu-20.04
env:
TERM: xterm
strategy:
matrix:
arch:
- x64
- arm64
node-version:
- '16'
os:
- linux
- macos
- win
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: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile --production
- name: Reset version if needed
run: |
git describe --tags --abbrev=1 && yarn bump "$(git describe --tags --abbrev=1 | cut -c2-)" package.json || echo "No tags yet. Skipping..."
node ./bin/hyperdrive
- name: Package into node binary
uses: lando/pkg-action@v2
with:
entrypoint: bin/hyperdrive
arch: ${{ matrix.arch }}
node-version: node${{ matrix.node-version }}
os: ${{ matrix.os }}
sign-n-deploy:
runs-on: ${{ matrix.os }}
needs:
- package
env:
TERM: xterm
strategy:
matrix:
include:
- os: windows-2022
key: hyperdrive-node16-win-x64-${{ github.sha }}
file: hyperdrive/hyperdrive.exe
certificate-data: WINDOZE_CERT_DATA
certificate-password: WINDOZE_CERT_PASSWORD
result: hyperdrive-win-x64-${{ github.ref_name }}.exe
- os: windows-2022
key: hyperdrive-node16-win-arm64-${{ github.sha }}
file: hyperdrive/hyperdrive.exe
certificate-data: WINDOZE_CERT_DATA
certificate-password: WINDOZE_CERT_PASSWORD
result: hyperdrive-win-arm64-${{ github.ref_name }}.exe
- os: macos-12
key: hyperdrive-node16-macos-x64-${{ github.sha }}
file: hyperdrive/hyperdrive
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.hyperdrive
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: hyperdrive-macos-x64-${{ github.ref_name }}
- os: macos-12
key: hyperdrive-node16-macos-arm64-${{ github.sha }}
file: hyperdrive/hyperdrive
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.hyperdrive
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: hyperdrive-macos-arm64-${{ github.ref_name }}
- os: ubuntu-22.04
key: hyperdrive-node16-linux-x64-${{ github.sha }}
file: hyperdrive/hyperdrive
result: hyperdrive-linux-x64-${{ github.ref_name }}
- os: ubuntu-22.04
key: hyperdrive-node16-linux-arm64-${{ github.sha }}
file: hyperdrive/hyperdrive
result: hyperdrive-linux-arm64-${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download ${{ matrix.key }}
uses: actions/download-artifact@v3
with:
name: ${{ matrix.key }}
path: hyperdrive
- name: Sign and Notarize
uses: lando/code-sign-action@v2
id: code-sign-action
with:
file: ${{ matrix.file }}
certificate-data: ${{ secrets[matrix.certificate-data] }}
certificate-password: ${{ secrets[matrix.certificate-password] }}
apple-notary-user: ${{ secrets[matrix.apple-notary-user] }}
apple-notary-password: ${{ secrets[matrix.apple-notary-password] }}
apple-product-id: ${{ matrix.apple-product-id }}
apple-team-id: ${{ matrix.apple-team-id }}
options: ${{ matrix.options }}
- name: Rename as needed
shell: bash
run: |
mkdir -p releases
cp ${{ steps.code-sign-action.outputs.file }} releases/${{ matrix.result }}
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/latest/;')"
cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/dev/;')"
chmod +x releases/*
ls -lsa releases
- 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 dev releases to S3
shell: bash
run: aws s3 sync releases s3://files.lando.dev/hyperdrive