From c44f6525fb6bcbf58c6024a113a75c3ed4135bd1 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Mon, 7 Aug 2023 07:58:29 +0200 Subject: [PATCH] build: Snap in CI --- .github/workflows/main_deploy.yaml | 15 +++++++++++++++ .github/workflows/release.yaml | 26 ++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index 3c60b6de4..7ff689b68 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -78,3 +78,18 @@ jobs: bundle update fastlane bundle exec fastlane deploy_internal_test cd .. + + deploy_snap: + runs-on: ubuntu-latest + outputs: + snap-file: ${{ steps.build-snap.outputs.snap }} + steps: + - uses: actions/checkout@v3 + - uses: snapcore/action-build@v1 + id: build-snap + - uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} + with: + snap: ${{ steps.build-snap.outputs.snap }} + release: 'edge' diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 574d37de2..7aca3a270 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -136,10 +136,32 @@ jobs: bundle install bundle update fastlane bundle exec fastlane deploy_internal_test - RELEASE_TYPE=$(echo "${GITHUB_REF_NAME}" | awk -F"/" '{print $3}') - if [ "$RELEASE_TYPE" = "rc" ]; then + if [[ $GITHUB_REF_NAME == rc* ]]; then bundle exec fastlane deploy_candidate else bundle exec fastlane deploy_release fi cd .. + + deploy_snap: + runs-on: ubuntu-latest + outputs: + snap-file: ${{ steps.build-snap.outputs.snap }} + steps: + - uses: actions/checkout@v3 + - uses: snapcore/action-build@v1 + id: build-snap + - name: Set release type + id: set-release + run: | + if [[ "${GITHUB_REF_NAME}" == rc* ]]; then + echo "::set-output name=release::candidate" + else + echo "::set-output name=release::stable" + fi + - uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} + with: + snap: ${{ steps.build-snap.outputs.snap }} + release: ${{ steps.set-release.outputs.release }} \ No newline at end of file