-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automates version increment of winget package (#337)
This automates updates of the func-e package on winget. This uses manifest generated locally, so we can control the contents easily. Signed-off-by: Adrian Cole <[email protected]>
- Loading branch information
1 parent
d488e66
commit 5614f43
Showing
2 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ on: | |
env: | ||
GIT_USER_NAME: Tetrate Labs CI | ||
GIT_USER_EMAIL: [email protected] | ||
GIT_COMMITTER: Tetrate Labs CI <[email protected]> | ||
|
||
jobs: | ||
homebrew: | ||
|
@@ -41,3 +42,60 @@ jobs: | |
brew bump-formula-pr --no-browse --no-audit --version "${version}" func-e | ||
env: # See env section for notes on PACKAGE_BUMP_TOKEN | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.PACKAGE_BUMP_TOKEN }} | ||
|
||
# This job downloads the func-e.msi from the corresponding release. It extracts properties from | ||
# it in order to create a winget package manifest. Finally, it creates a pull request to add the | ||
# new version. The pull request is a branch on tetratelabs/winget-pkgs so that anyone on the team | ||
# can edit it as necessary. | ||
msi: | ||
name: "microsoft/winget-create" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout func-e" | ||
uses: actions/checkout@v2 | ||
with: | ||
path: func-e | ||
|
||
- name: "Checkout winget-pkgs" | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: microsoft/winget-pkgs | ||
ref: master | ||
path: winget-pkgs | ||
|
||
- name: "Write winget manifest" | ||
run: | | ||
tag="${GITHUB_REF#refs/tags/}" | ||
version=${tag#v} | ||
echo "MSI_VERSION=${version}" >> $GITHUB_ENV | ||
cd func-e | ||
gh release download "${tag}" -p '*windows_amd64.msi' | ||
manifest_path=../winget-pkgs/manifests/Tetrate/func-e/${version}/Tetrate.func-e.yaml | ||
mkdir -p $(dirname ${manifest_path}) | ||
./packaging/msi/winget_manifest.sh ${version} *windows_amd64.msi > ${manifest_path} | ||
env: # See env section for notes on PACKAGE_BUMP_TOKEN | ||
GITHUB_TOKEN: ${{ secrets.PACKAGE_BUMP_TOKEN }} | ||
|
||
- name: "Create winget-pkgs pull request" | ||
uses: peter-evans/create-pull-request@v3 | ||
id: winget-pkgs-pr | ||
with: | ||
path: winget-pkgs | ||
branch: func-e-${{ env.MSI_VERSION }} | ||
delete-branch: true | ||
push-to-fork: tetratelabs/winget-pkgs | ||
commit-message: "New version: Tetrate.func-e version ${{ env.MSI_VERSION }}" | ||
committer: ${{ env.GIT_COMMITTER }} | ||
author: ${{ env.GIT_COMMITTER }} | ||
title: "New version: Tetrate.func-e version ${{ env.MSI_VERSION }}" | ||
body: | | ||
- [x] Have you signed the [Contributor License Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs)? | ||
- [x] Have you checked that there aren't other open [pull requests](https://github.com/microsoft/winget-pkgs/pulls) for the same manifest update/change? | ||
- [x] Have you validated your manifest locally with `winget validate --manifest <path>`? | ||
- [x] Have you tested your manifest locally with `winget install --manifest <path>`? | ||
- [x] Does your manifest conform to the [1.0 schema](https://github.com/microsoft/winget-cli/blob/master/doc/ManifestSpecv1.0.md)? | ||
token: ${{ secrets.PACKAGE_BUMP_TOKEN }} | ||
|
||
- name: "Echo winget-pkgs pull request" | ||
run: | | ||
echo ${{ steps.winget-pkgs-pr.outputs.pull-request-url }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters