Skip to content

Commit

Permalink
snap: enable multi platform source
Browse files Browse the repository at this point in the history
  • Loading branch information
boukendesho committed Sep 29, 2024
1 parent bd69cc6 commit 69aa7f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 73 deletions.
82 changes: 10 additions & 72 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,92 +27,30 @@ jobs:
echo "Upstream version is $upstream_version"
fi
- name: Checkout this repo on master(amd64)
- name: Checkout this repo on master
uses: actions/checkout@v4
with:
ref: master

- name: get snap current amd64 version
id: current_amd64
uses: mikefarah/yq@master
with:
cmd: yq '.version' 'snap/snapcraft.yaml'

- name: show snap current amd64 version
run: echo "Current version is ${{ steps.current_amd64.outputs.result }}"

- name: update to upstream's version number
id: update_amd64
if: steps.upstream.outputs.version != steps.current_amd64.outputs.result
uses: mikefarah/yq@master
with:
cmd: yq -i '.version = "${{ steps.upstream.outputs.version }}"' 'snap/snapcraft.yaml'

- name: Commit changes on amd64
if: steps.update_amd64.outcome == 'success'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "update snapcraft.yaml to version ${{ steps.upstream.outputs.version }}"
git push
- name: Checkout this repo on arm64
uses: actions/checkout@v4
with:
ref: arm64

- name: get snap current arm64 version
id: current_arm64
uses: mikefarah/yq@master
with:
cmd: yq '.version' 'snap/snapcraft.yaml'

- name: show snap current arm64 version
run: echo "Current version is ${{ steps.current_arm64.outputs.result }}"

- name: update to upstream's version number
id: update_arm64
if: steps.upstream.outputs.version != steps.current_arm64.outputs.result
uses: mikefarah/yq@master
with:
cmd: yq -i '.version = "${{ steps.upstream.outputs.version }}"' 'snap/snapcraft.yaml'

- name: Commit changes on arm64
if: steps.update_arm64.outcome == 'success'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "update snapcraft.yaml to version ${{ steps.upstream.outputs.version }}"
git push
- name: Checkout this repo on armhf
uses: actions/checkout@v4
with:
ref: armhf

- name: get snap current armhf version
id: current_armhf
- name: get snap current version
id: current
uses: mikefarah/yq@master
with:
cmd: yq '.version' 'snap/snapcraft.yaml'

- name: show snap current armhf version
run: echo "Current version is ${{ steps.current_armhf.outputs.result }}"
- name: show snap current version
run: echo "Current version is ${{ steps.current.outputs.result }}"

- name: update to upstream's version number
id: update_armhf
if: steps.upstream.outputs.version != steps.current_armhf.outputs.result
id: update
if: steps.upstream.outputs.version != steps.current.outputs.result
uses: mikefarah/yq@master
with:
cmd: yq -i '.version = "${{ steps.upstream.outputs.version }}"' 'snap/snapcraft.yaml'

- name: Commit changes on armhf
if: steps.update_armhf.outcome == 'success'
- name: Commit changes
if: steps.update.outcome == 'success'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "update snapcraft.yaml to version ${{ steps.upstream.outputs.version }}"
git push
git push
7 changes: 6 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ description: |
platforms:
amd64:
arm64:
armhf:

grade: stable
confinement: strict
Expand All @@ -26,5 +28,8 @@ apps:
parts:
speedtest:
plugin: dump
source: https://install.speedtest.net/app/cli/ookla-speedtest-${SNAPCRAFT_PROJECT_VERSION}-linux-x86_64.tgz
source:
- on amd64: https://install.speedtest.net/app/cli/ookla-speedtest-${SNAPCRAFT_PROJECT_VERSION}-linux-x86_64.tgz
- on arm64: https://install.speedtest.net/app/cli/ookla-speedtest-${SNAPCRAFT_PROJECT_VERSION}-linux-aarch64.tgz
- on armhf: https://install.speedtest.net/app/cli/ookla-speedtest-${SNAPCRAFT_PROJECT_VERSION}-linux-armhf.tgz
source-type: tar

0 comments on commit 69aa7f5

Please sign in to comment.