Skip to content

Commit

Permalink
add release github workflow and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kwtalley committed Apr 29, 2024
1 parent a2752e4 commit 2a33e56
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: provwasm-test-tube release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
- "v[0-9]+.[0-9]+.[0-9]+-beta*" # Push events to matching v*, i.e. v1.0.0-beta2

jobs:
# This action cleans up previously running instances of a workflow on the same branch. This accomplishes
# the task of automatically cancelling CI runs on pushes to the same branch, which is a common feature in
# most CI systems but currently not possible with GitHub actions.
cleanup_runs:
name: Cleanup Workflows
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

build_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create release
uses: softprops/action-gh-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ github.ref_name }}
draft: true
prerelease: false
body_path: RELEASE_CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@ jobs:
# the task of automatically cancelling CI runs on pushes to the same branch, which is a common feature in
# most CI systems but currently not possible with GitHub actions.
cleanup-runs:
name: Cleanup Workflows
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

build:
build_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

0 comments on commit 2a33e56

Please sign in to comment.