himalaya/.github/workflows/release.yml

78 lines
2.2 KiB
YAML
Raw Normal View History

name: release
on:
push:
tags:
- v*
jobs:
2024-01-01 15:22:30 +00:00
create-release:
runs-on: ubuntu-latest
outputs:
2024-01-01 15:22:30 +00:00
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Create release
2024-01-01 15:22:30 +00:00
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
2024-04-16 19:26:00 +00:00
deploy-releases:
runs-on: ${{ matrix.os }}
2024-01-01 15:22:30 +00:00
needs: create-release
strategy:
fail-fast: false
matrix:
include:
2024-04-16 19:26:00 +00:00
- target: x86_64-linux
os: ubuntu-latest
2024-04-20 05:50:57 +00:00
- target: aarch64-linux
2024-01-01 15:22:30 +00:00
os: ubuntu-latest
2024-04-16 19:26:00 +00:00
- target: x86_64-windows
os: ubuntu-latest
2024-04-20 05:50:57 +00:00
- target: x86_64-darwin
os: macos-latest
2024-04-20 05:50:57 +00:00
# FIXME: build broken
# - target: aarch64-darwin
# os: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v24
with:
2024-01-01 15:22:30 +00:00
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: soywod
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2024-04-16 19:26:00 +00:00
- name: Build release archive
run: |
2024-04-16 19:26:00 +00:00
nix build -L .#${{ matrix.target }}
2024-04-20 05:50:57 +00:00
cp result/himalaya* .
2024-04-16 19:26:00 +00:00
- name: Upload tgz release archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2024-01-01 15:22:30 +00:00
upload_url: ${{ needs.create-release.outputs.upload_url }}
2023-05-01 09:41:39 +00:00
asset_path: himalaya.tgz
2024-04-16 19:26:00 +00:00
asset_name: himalaya.${{ matrix.target }}.tgz
asset_content_type: application/gzip
2024-01-01 15:22:30 +00:00
- name: Upload zip release archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2024-01-01 15:22:30 +00:00
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: himalaya.zip
2024-04-16 19:26:00 +00:00
asset_name: himalaya.${{ matrix.target }}.zip
asset_content_type: application/zip