Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
maccesch committed Dec 10, 2024
0 parents commit 9949963
Show file tree
Hide file tree
Showing 11 changed files with 5,784 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":semanticCommitTypeAll(chore)",
"github>Turbo87/renovate-config//rust/updateToolchain"
],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
}
]
}
29 changes: 29 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test consuming this action
on:
release:
types: [released]
workflow_run:
workflows: ["Release"]
types: ["completed"]
jobs:
test_success:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./

test_error:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: test
continue-on-error: true
uses: ./
with:
error: "This is an error"
- name: Verify failure
if: steps.test.outputs.error != ''
run: echo "Failed as expected"
- name: Unexpected success
if: steps.test.outputs.error == ''
run: echo "Succeeded unexpectedly" && exit 1
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true

jobs:
build-artifacts:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
file_extension: .exe

runs-on: ${{ matrix.os }}
name: ${{ matrix.target }}
env:
binary_name: leptos-cloud-deploy-action${{ matrix.file_extension }}

steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

- name: Install host target
run: rustup target add ${{ matrix.target }}

- name: Install musl-tools
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
run: sudo apt-get install -y musl-tools

- name: Build
run: cargo build --release --target ${{ matrix.target }}

- name: Create Archive Folder
run: mkdir ${{ runner.os }}

- name: Copy Artifact
run: cp target/${{ matrix.target }}/release/${{ env.binary_name }} ${{ runner.os }}

- name: Create Tar Archive
run: tar -czf ${{ runner.os }}.tgz ${{ runner.os }}

- name: Store Archive
uses: actions/upload-artifact@v4
with:
name: ${{runner.os}}
path: ${{ runner.os }}.tgz

create-release:
needs: [build-artifacts]
runs-on: ubuntu-latest
name: Create Release
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "Linux/Linux.tgz,macOS/macOS.tgz,Windows/Windows.tgz"
tag: v${{ github.event.inputs.version }}
17 changes: 17 additions & 0 deletions .github/workflows/rust_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Unit tests, linting, and formatting
on: [push]
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Rust
run: |
rustup override set stable
rustup update stable
- name: Run tests
run: cargo test
- name: Lint
run: cargo clippy
- name: Check formatting
run: cargo fmt --check
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
/target
.DS_Store
Loading

0 comments on commit 9949963

Please sign in to comment.