Skip to content

Commit

Permalink
ci(release): add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Jul 30, 2024
1 parent e83eb51 commit 87580ab
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: release

on:
push:
branches:
- beta
- main

jobs:
lint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
deno: [v1.x]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Lint
run: |
deno fmt --check
deno lint
test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
deno: [v1.x]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Test
run: deno task test --coverage=coverage

- name: Generate coverage
run: deno coverage coverage --output=cov_profile.lcov --lcov

- uses: codecov/codecov-action@v4
with:
files: cov_profile.lcov
token: ${{ secrets.CODECOV_TOKEN }}

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1

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

release:
needs: [lint, test]
runs-on: ${{ matrix.os }}
permissions:
contents: write

strategy:
matrix:
os: [ubuntu-latest]
target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Compile and release
uses: rust-build/rust-build.action@v1.4.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}

0 comments on commit 87580ab

Please sign in to comment.