Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release pipeline by goreleaser #944

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6fd6e3b
feat: add goreleaser
vedantmgoyal9 Jan 23, 2025
9787a34
fix(ci/goreleaser): remove steps with empty `run` field
vedantmgoyal9 Jan 23, 2025
d1ba210
ci: fix condition and don't release if cache was hit
vedantmgoyal9 Jan 23, 2025
b01e9ec
fix(ci): goreleaser needs `fetch-depth: 0` to work
vedantmgoyal9 Jan 23, 2025
ed79e52
[goreleaser] several fixes and improvements to config and ci
vedantmgoyal9 Jan 23, 2025
f1b9129
ci(goreleaser): don't build windows until msi is fixed
vedantmgoyal9 Jan 23, 2025
9637fbe
fix(goreleaser): app bundle embedding thin binary instead of fat binary
vedantmgoyal9 Jan 23, 2025
f790a16
concurrency
vedantmgoyal9 Jan 23, 2025
409921c
build portables for windows (msi is still is disabled)
vedantmgoyal9 Jan 23, 2025
f41fd76
test msi again with wix 5.0.2
vedantmgoyal9 Jan 23, 2025
d4c41fa
install wix v5 in ci instead of goreleaser before hooks
vedantmgoyal9 Jan 23, 2025
2416eda
ci: fix windows cache restore on linux
vedantmgoyal9 Jan 23, 2025
944f202
disable msi, needs work at goreleaser side
vedantmgoyal9 Jan 23, 2025
a8291e8
update according to new changes
vedantmgoyal9 Jan 24, 2025
8d9de9b
install wix extensions globally
vedantmgoyal9 Jan 24, 2025
e6f7b48
🤦🏻‍♂️
vedantmgoyal9 Jan 24, 2025
a572182
update
vedantmgoyal9 Jan 24, 2025
ea82d32
some fixes related to msi
vedantmgoyal9 Jan 24, 2025
000fce5
try one more time 😤
vedantmgoyal9 Jan 25, 2025
47d3e45
Apply suggestions from code review
vedantmgoyal9 Jan 25, 2025
b9bee73
😭🤧
vedantmgoyal9 Jan 25, 2025
3c7c4fd
Update workflow name to 'Release'
vedantmgoyal9 Jan 26, 2025
cb9dafa
rename workflow to release and enable linux
raphamorim Feb 8, 2025
baa0ce3
enable cache for linux
raphamorim Feb 8, 2025
b76e36b
let's start testing stuff
raphamorim Feb 8, 2025
de7a9c6
keep release as naming
raphamorim Feb 8, 2025
be2c499
rebase
raphamorim Feb 11, 2025
1e4ea29
rebase
raphamorim Feb 11, 2025
ffc109b
use ubuntu 24.04
raphamorim Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 91 additions & 130 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,150 +1,111 @@
name: Release

on:
push:
tags:
- 'v*.*.*'
on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
GITHUB_REPOSITORY: raphamorim/rio
RUST_BACKTRACE: full
RUSTFLAGS: '-C link-arg=-s'
# on:
# push:
# branches: [ main ]
# tags:
# - 'v*.*.*'
# schedule:
# - cron: '0 0 * * *'
# workflow_dispatch:

concurrency:
group: release-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
release-macos:
runs-on: macos-latest
build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
discussions: write

strategy:
matrix:
include:
- os: macos-latest
cache-subdir: darwin
secondary_target: x86_64-apple-darwin
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
partial-by: target
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
partial-by: target
- os: windows-latest
cache-subdir: windows
secondary_target: aarch64-pc-windows-msvc
fail-fast: false
outputs:
cache-hit: ${{ steps.cache-check.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: rustup toolchain install stable --profile minimal
- run: rustup target add x86_64-apple-darwin aarch64-apple-darwin
- run: make release-macos
- name: Release version
uses: softprops/action-gh-release@v2
with:
append_body: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
release/macos-unsigned.zip
LICENSE

release-deb-x84:
runs-on: ubuntu-22.04
permissions:
contents: write
discussions: write

steps:
- uses: actions/checkout@v4
- name: rust cache
uses: Swatinem/rust-cache@v2
fetch-depth: 0
- uses: actions/cache@v4
with:
cache-all-crates: true

- run: sudo apt install rename
- run: rustup toolchain install stable --profile minimal
- run: cargo install cargo-deb
- run: mkdir -p release
- run: make release-debian-x11
- run: make release-debian-wayland
- name: Release
uses: softprops/action-gh-release@v1
path: dist/${{ matrix.cache-subdir || matrix.target }}
key: goreleaser-${{ matrix.target || matrix.os }}-${{ github.sha }}
enableCrossOsArchive: ${{ matrix.os == 'windows-latest' }}
lookup-only: true
fail-on-cache-miss: false
id: cache-check
- if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
run: rustup target add ${{ matrix.secondary_target }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && steps.cache-check.outputs.cache-hit != 'true'
uses: goreleaser/[email protected]
with:
append_body: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
release/debian/x11/*
release/debian/wayland/*

release-deb-arm:
runs-on: ubuntu-22.04-arm
permissions:
contents: write
discussions: write

distribution: goreleaser-pro
version: nightly
args: release --clean --split # --partial-by ${{ matrix.partial-by || 'goos' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v'))) && steps.cache-check.outputs.cache-hit != 'true'
uses: goreleaser/[email protected]
with:
distribution: goreleaser-pro
version: nightly
args: release --clean --split --nightly # --partial-by ${{ matrix.partial-by || 'goos' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
release:
# skip if cache exists for same commit, since we probably already released
if: needs.build.outputs.cache-hit != 'true'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: rust cache
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true

- run: sudo apt install rename
- run: rustup toolchain install stable --profile minimal
- run: cargo install cargo-deb
- run: mkdir -p release
- run: make release-debian-x11
- run: make release-debian-wayland
- name: Release
uses: softprops/action-gh-release@v1
fetch-depth: 0
- uses: actions/cache@v4
with:
append_body: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
release/debian/x11/*
release/debian/wayland/*

release-windows:
runs-on: windows-latest
defaults:
run:
shell: bash
permissions:
contents: write
discussions: write

strategy:
matrix:
include:
- target: x86_64
wix-arch: x64
- target: aarch64
wix-arch: arm64

steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
key: goreleaser-macos-latest-${{ github.sha }}
path: dist/darwin
fail-on-cache-miss: true
- uses: actions/cache@v4
with:
key: ${{matrix.target}}
- name: Install WiX
run: dotnet tool install --global wix --version 4.0.5
- run: wix --version
- run: wix extension add WixToolset.UI.wixext/4.0.5 WixToolset.Util.wixext/4.0.5
- run: rustup toolchain install stable --profile minimal --target ${{ matrix.target }}-pc-windows-msvc
- run: cargo build --target ${{ matrix.target }}-pc-windows-msvc --release
- name: Crate msi installer
run: |
wix build -arch "${{ matrix.wix-arch}}" -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext \
-out "./Rio-installer-${{ matrix.target }}.msi" "misc/windows/rio-${{ matrix.target }}.wxs"
- run: cp ./target/${{ matrix.target }}-pc-windows-msvc/release/rio.exe ./Rio-portable-${{ matrix.target }}.exe
- name: Release
uses: softprops/action-gh-release@v1
key: goreleaser-windows-latest-${{ github.sha }}
path: dist/windows
fail-on-cache-miss: true
- uses: actions/cache@v4
with:
append_body: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
./Rio-installer-${{ matrix.target }}.msi
./Rio-portable-${{ matrix.target }}.exe

publish-winget:
runs-on: windows-latest
needs: release-windows
defaults:
run:
shell: bash
permissions:
contents: write
discussions: write

steps:
- uses: vedantmgoyal9/winget-releaser@main
key: goreleaser-x86_64-unknown-linux-gnu-${{ github.sha }}
path: dist/x86_64-unknown-linux-gnu
fail-on-cache-miss: true
- uses: actions/cache@v4
with:
identifier: raphamorim.rio
token: ${{ secrets.WINGET_TOKEN }}
installers-regex: '\.msi$' # Only .msi files

key: goreleaser-aarch64-unknown-linux-gnu-${{ github.sha }}
path: dist/aarch64-unknown-linux-gnu
fail-on-cache-miss: true
- uses: goreleaser/[email protected]
with:
distribution: goreleaser-pro
version: nightly
args: continue --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
# macos notarization env vars
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ NOTES

# for nix users
.direnv/

# compiled terminfo files
misc/72/

# goreleaser
dist/
Loading
Loading