149 lines
5.8 KiB
YAML
149 lines
5.8 KiB
YAML
# CI that:
|
|
#
|
|
# * checks for a Git Tag that looks like a release
|
|
# * creates a Github Release™ and fills in its text
|
|
# * builds artifacts with cargo-dist (executable-zips, installers)
|
|
# * uploads those artifacts to the Github Release™
|
|
#
|
|
# Note that the Github Release™ will be created before the artifacts,
|
|
# so there will be a few minutes where the release has no artifacts
|
|
# and then they will slowly trickle in, possibly failing. To make
|
|
# this more pleasant we mark the release as a "draft" until all
|
|
# artifacts have been successfully uploaded. This allows you to
|
|
# choose what to do with partial successes and avoids spamming
|
|
# anyone with notifications before the release is actually ready.
|
|
name: Release
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
# This task will run whenever you push a git tag that looks like a version
|
|
# like "v1", "v1.2.0", "v0.1.0-prerelease01", "my-app-v1.0.0", etc.
|
|
# The version will be roughly parsed as ({PACKAGE_NAME}-)?v{VERSION}, where
|
|
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
|
|
# must be a Cargo-style SemVer Version.
|
|
#
|
|
# If PACKAGE_NAME is specified, then we will create a Github Release™ for that
|
|
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
|
|
#
|
|
# If PACKAGE_NAME isn't specified, then we will create a Github Release™ for all
|
|
# (cargo-dist-able) packages in the workspace with that version (this is mode is
|
|
# intended for workspaces with only one dist-able package, or with all dist-able
|
|
# packages versioned/released in lockstep).
|
|
#
|
|
# If you push multiple tags at once, separate instances of this workflow will
|
|
# spin up, creating an independent Github Release™ for each one.
|
|
#
|
|
# If there's a prerelease-style suffix to the version then the Github Release™
|
|
# will be marked as a prerelease.
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*-?v[0-9]+*'
|
|
|
|
jobs:
|
|
# Create the Github Release™ so the packages have something to be uploaded to
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
has-releases: ${{ steps.create-release.outputs.has-releases }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
- name: Install Zig toolchain
|
|
uses: korandoru/setup-zig@v1
|
|
with:
|
|
zig-version: 0.10.0
|
|
- name: Install Cargo Lambda
|
|
uses: jaxxstorm/action-install-gh-release@v1.9.0
|
|
with:
|
|
repo: cargo-lambda/cargo-lambda
|
|
platform: linux # Other valid options: 'windows' or 'darwin'
|
|
arch: x86_64 # Other valid options for linux: 'aarch64'
|
|
- name: Build release
|
|
run: cargo lambda build --release --output-format zip
|
|
|
|
- name: release
|
|
uses: actions/create-release@v1
|
|
id: create_release
|
|
with:
|
|
draft: false
|
|
prerelease: false
|
|
release_name: ${{ steps.version.outputs.version }}
|
|
tag_name: ${{ github.ref }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
- name: Upload oxbow lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/oxbow-lambda/bootstrap.zip
|
|
asset_name: oxbow-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload group-events lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/group-events/bootstrap.zip
|
|
asset_name: group-events-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload auto-tag lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/auto-tag/bootstrap.zip
|
|
asset_name: auto-tag-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload webhook lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/webhook/bootstrap.zip
|
|
asset_name: webhook-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload sqs-ingest lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/sqs-ingest/bootstrap.zip
|
|
asset_name: sqs-ingest-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload glue-create lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/glue-create/bootstrap.zip
|
|
asset_name: glue-create-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload glue-sync lambda
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./target/lambda/glue-sync/bootstrap.zip
|
|
asset_name: glue-sync-lambda-bootstrap-${{ github.ref_name }}.zip
|
|
asset_content_type: application/zip
|