Skip to content

Commit

Permalink
devops: added release pipeline and automatic issue closing
Browse files Browse the repository at this point in the history
Signed-off-by: aserowy <serowy@hotmail.com>
  • Loading branch information
aserowy committed Feb 20, 2024
1 parent 00768ec commit 3db2a65
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration for probot-no-response - https://github.com/probot/no-response
daysUntilClose: 14
responseRequiredLabel: question
closeComment: >
This issue has been automatically closed because there has been no response
to the request for more information from the original author. With only the
information that is currently in the issue, there isn't enough information
to take further action. Please reach out if you have or find the answers we
need so that we can investigate further.
84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
release:
permissions:
contents: write
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: setup rust
run: rustup toolchain install stable --profile minimal

- name: add targets
if: contains(fromJson('["aarch64-unknown-linux-gnu", "aarch64-apple-darwin", "aarch64-pc-windows-msvc"]'), matrix.target)
run: rustup target add ${{ matrix.target }}

- name: install gcc for linux target
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -yq gcc-aarch64-linux-gnu
- name: setup rust cache
uses: Swatinem/rust-cache@v2

- name: build target
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
run: cargo build --release --locked --target ${{ matrix.target }}

- name: build snap
if: matrix.target == 'x86_64-unknown-linux-gnu'
uses: snapcore/action-build@v1

- name: pack unix artifacts
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
env:
TARGET_NAME: yeet-${{ matrix.target }}
run: |
mkdir $TARGET_NAME
cp target/${{ matrix.target }}/release/yeet $TARGET_NAME
cp README.md LICENSE $TARGET_NAME
zip -r $TARGET_NAME.zip $TARGET_NAME
- name: pack win artifacts
if: matrix.os == 'windows-latest'
env:
TARGET_NAME: yeet-${{ matrix.target }}
run: |
New-Item -ItemType Directory -Path ${env:TARGET_NAME}
Copy-Item -Path "target\${{ matrix.target }}\release\yeet.exe" -Destination ${env:TARGET_NAME}
Copy-Item -Path "README.md", "LICENSE" -Destination ${env:TARGET_NAME}
Compress-Archive -Path ${env:TARGET_NAME} -DestinationPath "${env:TARGET_NAME}.zip"
- name: release on gh
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
yeet-${{ matrix.target }}.zip
yeet*.snap
generate_release_notes: true
2 changes: 1 addition & 1 deletion yeet-frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub async fn run(settings: Settings) -> Result<(), AppError> {
PostRenderAction::Open(path) => {
let path = path.clone();

// TODO: check with mime if suspend/resume is necessary
// TODO: check with mime if suspend/resume is necessary?
match emitter.suspend().await {
Ok(result) => {
if !result {
Expand Down
2 changes: 1 addition & 1 deletion yeet-frontend/src/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub async fn path(path: &Path) -> Result<ExitStatus, io::Error> {
Ok(file_contents) => {
file_contents.contains("docker") || fs::metadata("/.dockerenv").await.is_ok()
}
Err(_error) => false,
Err(_error) => false || fs::metadata("/.dockerenv").await.is_ok(),
}
}

Expand Down

0 comments on commit 3db2a65

Please sign in to comment.