Skip to content

Commit

Permalink
Merge pull request #36 from nautls/release-pipeline
Browse files Browse the repository at this point in the history
Release pipeline
  • Loading branch information
ross-weir authored Sep 20, 2023
2 parents 71aa4bb + 14d0553 commit cf85f05
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
Expand All @@ -20,7 +20,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
Expand All @@ -32,7 +32,7 @@ jobs:
os: [ubuntu-22.04, macos-12, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release

on:
# automatically run on pushes to main with a changed `version.ts` file
push:
branches:
- main
paths:
- src/version.ts
# allow for manual trigger
workflow_dispatch:

jobs:
compile:
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc, x86_64-apple-darwin, aarch64-apple-darwin]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Compile all targets
run: deno compile -A --output bin/ergomatic-${{ matrix.target }} --target ${{ matrix.target }} src/cli.ts
- uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: bin/*
release:
needs: [compile]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: release-artifacts
path: bin
- name: Get version
id: version
run: |
echo "::set-output name=version::$(grep -o -P '([0-9]+\.[0-9]+\.[0-9]+)' src/version.ts)"
- uses: ncipollo/release-action@v1
with:
artifacts: bin/*
commit: main
tag: v${{ steps.version.outputs.version }}
body: "Release version ${{ steps.version.outputs.version }}"

0 comments on commit cf85f05

Please sign in to comment.