Skip to content

Commit

Permalink
Merge branch 'classic-snap' into classic-snap-test
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Jan 30, 2024
2 parents 57208e7 + 1650aed commit 7d865fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/release-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:

jobs:
release-snap:
strategy:
matrix:
arch: [amd64,arm64,s390x]
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -44,28 +47,14 @@ jobs:
- name: make snapcraft
run: |
sed -i 's/{VERSION}/${{ steps.version.outputs.version }}/g' snapcraft.yaml
sed -i 's/{ARCH}/${{ matrix.arch }}/g' snapcraft.yaml
cat snapcraft.yaml
- uses: snapcore/action-build@v1
id: build
- uses: snapcore/action-publish@v1
name: publish amd64
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: 'oras-test_${{ steps.version.outputs.version }}_amd64.snap'
release: ${{ steps.version.outputs.release }}
- uses: snapcore/action-publish@v1
name: publish arm64
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: 'oras-test_${{ steps.version.outputs.version }}_arm64.snap'
release: ${{ steps.version.outputs.release }}
- uses: snapcore/action-publish@v1
name: publish s390x
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: 'oras-test_${{ steps.version.outputs.version }}_s390x.snap'
snap: ${{ steps.build.outputs.snap }}
release: ${{ steps.version.outputs.release }}

14 changes: 3 additions & 11 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ grade: stable

architectures:
- build-on: amd64
build-for: amd64
- build-on: amd64
build-for: arm64
- build-on: amd64
build-for: s390x
build-for: {ARCH}

parts:
oras-test:
Expand All @@ -35,12 +31,8 @@ parts:
source-type: git
source-tag: $SNAPCRAFT_PROJECT_VERSION
build-environment:
- on amd64 to amd64:
- TARGET_ARCH: "amd64"
- on amd64 to arm64:
- TARGET_ARCH: "arm64"
- on amd64 to s390x:
- TARGET_ARCH: "s390x"
- on amd64 to {ARCH}:
- TARGET_ARCH: "{ARCH}"
build-snaps:
- go/1.21/stable
build-packages:
Expand Down

0 comments on commit 7d865fe

Please sign in to comment.