Skip to content

app: Bump version to 0.28.0 #11

app: Bump version to 0.28.0

app: Bump version to 0.28.0 #11

name: PR for updating winget
# This action will run after a tag starting with "v" is published
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
jobs:
winget-update:
permissions:
contents: write # for Git to git push
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
steps:
- name: Checkout Headlamp
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: ${{ secrets.KINVOLK_REPOS_TOKEN }}
# we need the full history for the git tag command, so fetch all the branches
fetch-depth: 0
- name: Configure Git
run: |
user=${{github.actor}}
if [ -z $user ]; then
user=vyncent-t
fi
git config --global user.name "$user"
git config --global user.email "$user@users.noreply.github.com"
# Set up Node.js environment, pay attention to the version
# Some features might not be available in older versions
- name: Create node.js environment
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "21"
# Install the dependencies for the winget script
- name: Install winget dependencies
run: |
cd $GITHUB_WORKSPACE/app
npm ci
# We set the latest tag as an environment variable before we use it in the next steps
# note that we have to echo the variable to the environment file to make it available in the next steps
- name: Set latest tag
run: |
echo "Setting latest tag"
latestTag=$(git tag --list --sort=version:refname 'v*' | tail -1)
# Remove the 'v' from the tag
latestTag=${latestTag#v}
echo "LATEST_HEADLAMP_TAG=$latestTag" >> $GITHUB_ENV
echo $latestTag
# checkout the winget-pkgs repository
- name: Checkout winget-pkgs
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: headlamp-k8s/winget-pkgs
path: winget-pkgs
token: ${{ secrets.KINVOLK_REPOS_TOKEN }}
# we need the full history for the git tag command, so fetch all the branches
fetch-depth: 0
# Run the winget script
- name: Create winget package
run: |
echo "Running winget script"
echo "Repository: ${{ github.repository }}"
echo "Workspace: ${GITHUB_WORKSPACE}"
echo $GITHUB_WORKSPACE
pwd
echo "creating winget pkgs for ${LATEST_HEADLAMP_TAG}"
cd $GITHUB_WORKSPACE/app/windows/winget
node winget-create.js $LATEST_HEADLAMP_TAG $GITHUB_WORKSPACE/winget-pkgs/manifests/h/Headlamp/Headlamp
echo "Script finished"
- name: Create PR branch
run: |
user=${{github.actor}}
if [ -z $user ]; then
user=vyncent-t
fi
echo "Creating PR branch"
echo "Repository: ${{ github.repository }}"
echo "Workspace: ${GITHUB_WORKSPACE}"
pwd
echo "moving to winget-pkgs directory"
cd $GITHUB_WORKSPACE/winget-pkgs
pwd
ls
echo "moving to Headlamp directory"
cd $GITHUB_WORKSPACE/winget-pkgs/manifests/h/Headlamp/Headlamp
pwd
ls
git checkout -b "winget-update-$LATEST_HEADLAMP_TAG"
git add .
git commit -s -m "Update winget package $LATEST_HEADLAMP_TAG"
git push origin "winget-update-$LATEST_HEADLAMP_TAG"
env:
GITHUB_TOKEN: ${{ secrets.KINVOLK_REPOS_TOKEN }}
- name: Create Pull Request
run: |
echo "Create pull request"
echo "continue with the following link"
echo "https://github.com/headlamp-k8s/winget-pkgs/pull/new/winget-update-$LATEST_HEADLAMP_TAG"