-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (38 loc) · 1.72 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Update
on:
repository_dispatch:
types: [choco-formula-update]
workflow_dispatch:
inputs:
wash_version:
description: "Version of wash, without the `v`, to release to chocolatey"
required: true
default: "0.28.0"
jobs:
update-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version
if: github.event_name == 'workflow_dispatch'
run: |
echo "wash_version=${{ inputs.wash_version }}" >> $GITHUB_ENV
- name: Set Variables
if: github.event_name == 'repository_dispatch'
run: |
echo "wash_version=${{ github.event.client_payload.wash_version }}" >> $GITHUB_ENV
- name: Prepare Formula
run: |
wasmcloud_version=${{ env.wash_version }}
wasmcloud_url=https://github.com/wasmCloud/wasmCloud/releases/download/wash-cli-v$wasmcloud_version/wash-x86_64-pc-windows-msvc.exe
wasmcloud_sha=$(curl -sL $wasmcloud_url | shasum -a 256 | cut -d ' ' -f 1 | tr '[:lower:]' '[:upper:]')
cat ./template/chocolateyinstall.txt | sed "s|WASMCLOUD_URL|$wasmcloud_url|" | sed "s|WASMCLOUD_SHA|$wasmcloud_sha|" > tools/chocolateyinstall.ps1
cat ./template/wash.txt | sed "s|WASMCLOUD_VERSION|$wasmcloud_version|" > wash.nuspec
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: bump wash to v${{ env.wash_version }}
title: wash v${{ env.wash_version }}
body: This is the release of wash v${{ env.wash_version }}. Once tests pass properly, simply merge and then cut a tag from `main` for this version.
branch: release/v${{ env.wash_version }}
signoff: true