From 38308ec2f55a32034d42e9c6780795768818b1f0 Mon Sep 17 00:00:00 2001 From: ross-weir <29697678+ross-weir@users.noreply.github.com> Date: Wed, 20 Sep 2023 09:51:55 +1000 Subject: [PATCH 1/2] add release pipeline --- .github/workflows/release.yaml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ef83066 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,48 @@ +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@v2 + - 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] + steps: + - uses: actions/checkout@v2 + - 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 }}" + From 14d0553c2445620ac308208455c2a3618311db9d Mon Sep 17 00:00:00 2001 From: ross-weir <29697678+ross-weir@users.noreply.github.com> Date: Wed, 20 Sep 2023 10:16:54 +1000 Subject: [PATCH 2/2] upadte to latest checkout action --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/release.yaml | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81cd5c3..e3efd48 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ef83066..449b3c2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: 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@v2 + - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: deno-version: v1.x @@ -29,8 +29,11 @@ jobs: path: bin/* release: needs: [compile] + runs-on: ubuntu-latest + permissions: + contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: name: release-artifacts