Skip to content

Commit

Permalink
Merge pull request #3 from pirafrank/main
Browse files Browse the repository at this point in the history
CI and Release pipelines
  • Loading branch information
blank2121 authored Sep 8, 2024
2 parents a063a9c + 79f523e commit a24e3fe
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
pull_request:
branches:
- main
paths:
- .cargo/**
- src/**
- Cargo.lock
- Cargo.toml
- .github/workflows/ci.yml

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: wasm32-wasi

- name: Build project
run: cargo build
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
branches:
- main
paths:
- .cargo/**
- src/**
- Cargo.lock
- Cargo.toml
- .github/workflows/ci.yml

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Get app name
id: name
run: |
echo "name=zellij-jump-list" >> $GITHUB_OUTPUT
- name: Get app version
id: version
run: |
APP_VERSION=$(git rev-parse --short HEAD)
CURRENT_DATE=$(date +'%Y.%m.%d')
APP_VERSION_DATE="${CURRENT_DATE}-${APP_VERSION}"
echo "version=$APP_VERSION_DATE"
echo "version=$APP_VERSION_DATE" >> $GITHUB_OUTPUT
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: wasm32-wasi

- name: Build release
run: cargo build --release

- name: Generate SHA256 checksum
run: sha256sum ./target/wasm32-wasi/release/zellij-jump-list.wasm > ./target/wasm32-wasi/release/zellij-jump-list.wasm.sha256

- name: Create release and upload assets
uses: softprops/action-gh-release@v2
with:
files: |
./target/wasm32-wasi/release/zellij-jump-list.wasm
./target/wasm32-wasi/release/zellij-jump-list.wasm.sha256
name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
generate_release_notes: true
draft: false
prerelease: false
# Note: drafts and prereleases cannot be set as latest.
make_latest: true
fail_on_unmatched_files: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/target
target

0 comments on commit a24e3fe

Please sign in to comment.