Skip to content

Commit a3b6595

Browse files
committed
feat(ci): add aur job to npm-brew.yaml
This adds a new job called aur which checkouts code-server-aur, updates the files with the new version then opens a PR into the repo.
1 parent bef78e6 commit a3b6595

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/npm-brew.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,52 @@ jobs:
6767
env:
6868
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
6969
run: ./ci/steps/brew-bump.sh
70+
71+
aur:
72+
needs: npm
73+
runs-on: ubuntu-latest
74+
timeout-minutes: 10
75+
env:
76+
GH_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
77+
steps:
78+
# We need to checkout code-server so we can get the version
79+
- name: Checkout code-server
80+
uses: actions/checkout@v3
81+
with:
82+
fetch-depth: 0
83+
path: "./code-server"
84+
85+
- name: Get code-server version
86+
id: version
87+
run: |
88+
pushd code-server
89+
echo "::set-output name=version::$(jq -r .version package.json)"
90+
popd
91+
92+
- name: Checkout code-server-aur repo
93+
uses: actions/checkout@v3
94+
with:
95+
repository: "cdrci/code-server-aur"
96+
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
97+
98+
- name: Configure git
99+
run: |
100+
git config --global user.name cdrci
101+
git config --global user.email opensource@coder.com
102+
103+
- name: Validate package
104+
uses: hapakaien/archlinux-package-action@v2
105+
with:
106+
pkgver: ${{ steps.version.outputs.version }}
107+
updpkgsums: true
108+
srcinfo: true
109+
110+
- name: Open PR
111+
# We need to git push -u otherwise gh will prompt
112+
# asking where to push the branch.
113+
run: |
114+
git checkout -b update-version-${{ steps.version.outputs.version }}
115+
git add .
116+
git commit -m "chore: updating version to ${{ steps.version.outputs.version }}"
117+
git push -u origin $(git branch --show)
118+
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ steps.version.outputs.version }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR

0 commit comments

Comments
 (0)