2021-10-03 13:13:32 +00:00
|
|
|
# Huge thanks to Alacritty, as their configuration served as a starting point for this one!
|
|
|
|
# See: https://github.com/alacritty/alacritty
|
|
|
|
|
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
# TODO: replace this one with master
|
|
|
|
- dev-1.x-ci-pipelines
|
|
|
|
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
extract-version:
|
|
|
|
name: extract-version
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
espanso_version: ${{ steps.version.outputs.version }}
|
|
|
|
steps:
|
2021-10-03 13:16:15 +00:00
|
|
|
- uses: actions/checkout@v2
|
2021-10-03 13:13:32 +00:00
|
|
|
- name: "Extract version"
|
|
|
|
id: "version"
|
|
|
|
run: |
|
2021-10-03 13:16:15 +00:00
|
|
|
ESPANSO_VERSION=$(cat espanso/Cargo.toml | grep version | head -1 | awk -F '"' '{ print $2 }')
|
|
|
|
echo version: $ESPANSO_VERSION
|
|
|
|
echo "::set-output name=version::v$ESPANSO_VERSION"
|
2021-10-03 13:13:32 +00:00
|
|
|
|
|
|
|
windows:
|
|
|
|
needs: ["extract-version"]
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Print target version
|
|
|
|
run: |
|
|
|
|
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
|
2021-10-03 13:17:54 +00:00
|
|
|
- name: Install cargo-make
|
|
|
|
run: |
|
|
|
|
cargo install --force cargo-make
|
2021-10-03 13:13:32 +00:00
|
|
|
- name: Test
|
|
|
|
run: cargo make test-binary --profile release
|
|
|
|
- name: Build
|
|
|
|
run: cargo make build-windows-all --profile release
|
|
|
|
- name: Create portable mode archive
|
|
|
|
shell: powershell
|
|
|
|
run: |
|
2021-10-03 13:56:09 +00:00
|
|
|
Rename-Item target/windows/portable espanso-portable
|
2021-10-03 14:44:30 +00:00
|
|
|
Compress-Archive target/windows/espanso-portable target/windows/Espanso-Win-Portable-x86_64.zip
|
2021-10-03 13:13:32 +00:00
|
|
|
- name: Calculate hashes
|
2021-10-03 13:56:09 +00:00
|
|
|
shell: powershell
|
2021-10-03 13:13:32 +00:00
|
|
|
run: |
|
|
|
|
Get-FileHash target/windows/Espanso-Win-Portable-x86_64.zip -Algorithm SHA256 | select-object -ExpandProperty Hash > target/windows/Espanso-Win-Portable-x86_64.zip.sha256.txt
|
2021-10-03 15:27:14 +00:00
|
|
|
Get-FileHash target/windows/installer/Espanso-Win-Installer-x86_64.exe -Algorithm SHA256 | select-object -ExpandProperty Hash > target/windows/installer/Espanso-Win-Installer-x86_64.exe.sha256.txt
|
2021-10-03 14:44:30 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
name: "Upload artifacts"
|
|
|
|
with:
|
|
|
|
name: Windows Installer and Portable
|
|
|
|
path: |
|
2021-10-03 15:27:14 +00:00
|
|
|
target/windows/installer/Espanso-Win-Installer-x86_64.exe
|
2021-10-03 14:44:30 +00:00
|
|
|
target/windows/Espanso-Win-Portable-x86_64.zip
|
2021-10-03 15:27:14 +00:00
|
|
|
target/windows/installer/Espanso-Win-Installer-x86_64.exe.sha256.txt
|
|
|
|
target/windows/Espanso-Win-Portable-x86_64.zip.sha256.txt
|
2021-10-03 14:44:30 +00:00
|
|
|
- name: Upload artifacts to Github Releases
|
2021-10-03 13:13:32 +00:00
|
|
|
run: |
|
2021-10-03 15:27:14 +00:00
|
|
|
gh release upload ${{ needs.extract-version.outputs.espanso_version }} target/windows/installer/Espanso-Win-Installer-x86_64.exe target/windows/Espanso-Win-Portable-x86_64.zip target/windows/installer/Espanso-Win-Installer-x86_64.exe.sha256.txt target/windows/Espanso-Win-Portable-x86_64.zip.sha256.txt
|
|
|
|
|
|
|
|
linux-x11:
|
|
|
|
needs: ["extract-version"]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Print target version
|
|
|
|
run: |
|
|
|
|
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
|
|
|
|
- name: Build docker image
|
|
|
|
run: |
|
|
|
|
sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
|
|
|
|
- name: Build AppImage
|
|
|
|
run: |
|
|
|
|
sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_appimage.sh
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
name: "Upload artifacts"
|
|
|
|
with:
|
|
|
|
name: Linux X11 AppImage
|
|
|
|
path: |
|
|
|
|
shared/Espanso-X11.AppImage
|
|
|
|
shared/Espanso-X11.AppImage.sha256.txt
|
|
|
|
- name: Upload artifacts to Github Releases
|
|
|
|
run: |
|
|
|
|
gh release upload ${{ needs.extract-version.outputs.espanso_version }} shared/Espanso-X11.AppImage shared/Espanso-X11.AppImage.sha256.txt
|
2021-10-03 13:13:32 +00:00
|
|
|
# macos-intel:
|
|
|
|
# runs-on: macos-11
|
|
|
|
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - name: Install cargo-make
|
|
|
|
# run: |
|
|
|
|
# cargo install --force cargo-make
|
|
|
|
# - name: Run test suite
|
|
|
|
# run: cargo make test
|
|
|
|
# - name: Build
|
|
|
|
# run: |
|
|
|
|
# cargo make build-binary ./Alacritty-${GITHUB_REF##*/}-installer.msi $GITHUB_TOKEN
|
|
|
|
# linux:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - name: Install dependencies
|
|
|
|
# run: |
|
|
|
|
# sudo apt-get install cmake pkg-config libfreetype6-dev libfontconfig1-dev \
|
|
|
|
# libxcb-xfixes0-dev libxkbcommon-dev python3
|
|
|
|
# - name: Test
|
|
|
|
# run: cargo test --release
|
|
|
|
# - name: Gzip manpage
|
|
|
|
# run: gzip -c "./extra/alacritty.man" > "./alacritty.1.gz"
|
|
|
|
# - name: Upload Assets
|
|
|
|
# run: |
|
|
|
|
# mv ./extra/logo/alacritty-term.svg ./Alacritty.svg
|
|
|
|
# ./.github/workflows/upload_asset.sh ./Alacritty.svg $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./alacritty.1.gz $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./extra/completions/alacritty.bash $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./extra/completions/alacritty.fish $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./extra/completions/_alacritty $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./extra/linux/Alacritty.desktop $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./extra/alacritty.info $GITHUB_TOKEN
|
|
|
|
# ./.github/workflows/upload_asset.sh ./alacritty.yml $GITHUB_TOKEN
|