release #57
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 | |
on: | |
release: | |
types: [prereleased] | |
jobs: | |
artifacts: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: denoland/setup-deno@main | |
with: | |
deno-version: "~1.41" | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/deno # see https://deno.land/manual/linking_to_external_code | |
key: ${{ runner.os }}-deno # it seems there's no particular cache keying required | |
restore-keys: | | |
${{ runner.os }}-deno | |
- run: ./build.sh | |
- name: upload x86_64-unknown-linux-gnu | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./bin/collie-x86_64-unknown-linux-gnu.tar.gz | |
asset_name: collie-x86_64-unknown-linux-gnu.tar.gz | |
asset_content_type: application/gzip | |
- name: upload x86_64-apple-darwin | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./bin/collie-x86_64-apple-darwin.tar.gz | |
asset_name: collie-x86_64-apple-darwin.tar.gz | |
asset_content_type: application/gzip | |
- name: upload aarch64-apple-darwin | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./bin/collie-aarch64-apple-darwin.tar.gz | |
asset_name: collie-aarch64-apple-darwin.tar.gz | |
asset_content_type: application/gzip | |
- name: upload x86_64-pc-windows-msvc | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./bin/collie-x86_64-pc-windows-msvc.exe | |
asset_name: collie-x86_64-pc-windows-msvc.exe | |
asset_content_type: application/vnd.microsoft.portable-executable | |
# these e2e tests are super basic and just checks whether collie blows up | |
e2e-windows: | |
runs-on: windows-latest | |
needs: artifacts | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies | |
# We use the cloud CLIs github packages in their [default runner images](https://github.com/actions/runner-images). | |
# The runner images miss terraform, so we use chocolatey to install those quickly here. | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install --force terraform terragrunt terraform-docs | |
- name: install collie | |
shell: pwsh | |
env: | |
COLLIE_VERSION: ${{ github.event.release.tag_name }} | |
run: | | |
irm https://raw.githubusercontent.com/meshcloud/collie-cli/main/install.ps1 | iex | |
# github doesn't allow adding to PATH any other way, see https://stackoverflow.com/a/71579543/125407 | |
Add-Content $env:GITHUB_PATH "C:\Users\runneradmin\collie-cli" | |
- name: collie info | |
shell: pwsh | |
run: | | |
collie info | |
- name: test | |
shell: pwsh | |
run: .\test\e2e.ps1 | |
e2e-linux: | |
runs-on: ubuntu-latest | |
needs: artifacts | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies | |
# note: we forego using the flake.nix development environment and try to be as close to a realistic user experience as possible. | |
# This means that we use the cloud CLIs github packages in their [default runner images](https://github.com/actions/runner-images). | |
# The runner images miss terraform and unfortunately ubuntu doesn't package it and related tools very well, | |
# so we abuse nix to install those quickly here. | |
uses: cachix/install-nix-action@v22 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- uses: rrbutani/use-nix-shell-action@v1 | |
env: | |
NIXPKGS_ALLOW_UNFREE: 1 # terraform uses BSL license now, so we have to enable unfree | |
with: | |
packages: terraform,terragrunt,terraform-docs | |
- name: run test | |
env: | |
COLLIE_VERSION: ${{ github.event.release.tag_name }} | |
run: | | |
curl -sf -L https://raw.githubusercontent.com/meshcloud/collie-cli/main/install.sh | sudo bash | |
collie info | |
./test/e2e.sh | |
e2e-macos: | |
runs-on: macos-latest | |
needs: artifacts | |
steps: | |
- uses: actions/checkout@v4 | |
# note: we forego using the flake.nix development environment and try to be as close to a realistic user experience as possible. | |
# This means that we use the cloud CLIs github packages in their [default runner images](https://github.com/actions/runner-images). | |
# The runner images miss terraform so we use a standard brew command to install them here | |
- name: install dependencies | |
run: brew install terraform terragrunt terraform-docs | |
- name: run test | |
env: | |
COLLIE_VERSION: ${{ github.event.release.tag_name }} | |
run: | | |
curl -sf -L https://raw.githubusercontent.com/meshcloud/collie-cli/main/install.sh | sudo bash | |
collie info | |
./test/e2e.sh |