Skip to content

fix outputs

fix outputs #80

name: 📦 Publish to candidate
on:
# Run the workflow each time new commits are pushed to the candidate branch.
push:
branches: [ "candidate" ]
# Allow the workflow to be started manually from the Actions tab.
workflow_dispatch:
# Allow the workflow to be started by another workflow.
workflow_call:
secrets:
SNAP_STORE_CANDIDATE:
required: true
LP_BUILD_SECRET:
required: true
# Permissions for GITHUB_TOKEN
permissions:
contents: read
issues: write
env:
# Use the name of the repo as the name of the snap
SNAP_NAME: ${{ github.event.repository.name }}
# Hardcoded git branch and Snap Store channel channel
CHANNEL: 'candidate'
jobs:
build:
name: "Build and publish snap"
environment: "Candidate Branch"
runs-on: ubuntu-latest
steps:
- name: Checkout the source
uses: actions/checkout@v3
with:
ref: ${{ env.CHANNEL }}
- name: Setup snapcraft
env:
LP_BUILD_SECRET: ${{ secrets.LP_BUILD_SECRET }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_CANDIDATE }}
run: |
sudo snap install snapcraft --classic
# Setup Launchpad credentials
mkdir -p ~/.local/share/snapcraft/provider/launchpad
echo "$LP_BUILD_SECRET" > ~/.local/share/snapcraft/provider/launchpad/credentials
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
- name: Remote build the snap
id: build
run : |
snapcraft remote-build --launchpad-accept-public-upload
version="$(cat snap/snapcraft.yaml | yq -r '.version')"
echo "amd64_snap=signal_desktop_${version}_amd64.snap" >> "$GITHUB_OUTPUT"
echo "arm64_snap=signal_desktop_${version}_arm64.snap" >> "$GITHUB_OUTPUT"
- name: Review the built amd64 snap
uses: diddlesnaps/snapcraft-review-action@v1
with:
snap: ${{ steps.build.outputs.amd64_snap }}
isClassic: 'false'
- name: Review the built arm64 snap
uses: diddlesnaps/snapcraft-review-action@v1
with:
snap: ${{ steps.build.outputs.arm64_snap }}
isClassic: 'false'
- name: Publish the amd64 snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_CANDIDATE }}
with:
snap: ${{ steps.build.outputs.amd64_snap }}
release: ${{ env.CHANNEL }}
- name: Publish the arm64 snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_CANDIDATE }}
with:
snap: ${{ steps.build.outputs.arm64_snap }}
release: ${{ env.CHANNEL }}
create_issue:
name: "Create call for testing"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/testing-issue-template.md