Snap Cron #125488
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Snap Cron | |
permissions: | |
contents: write | |
on: | |
push: | |
schedule: | |
- cron: '*/15 * * * *' | |
jobs: | |
check: | |
strategy: | |
fail-fast: false | |
matrix: | |
track: [main, 22, 21, 20, 18] | |
name: Check branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: node${{ matrix.track }} | |
fetch-depth: 0 | |
if: ${{ matrix.track != 'main' }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
if: ${{ matrix.track == 'main' }} | |
- name: Init git config | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email [email protected] | |
git remote add launchpad git+ssh://[email protected]/node-snap | |
mkdir ~/.ssh/ | |
chmod 700 ~/.ssh | |
echo "Host git.launchpad.net" > ~/.ssh/config | |
echo " User openjs" >> ~/.ssh/config | |
echo " IdentityFile ~/.ssh/launchpad_rsa" >> ~/.ssh/config | |
echo -e "${{ secrets.LAUNCHPAD_RSA }}" > ~/.ssh/launchpad_rsa | |
chmod 600 ~/.ssh/launchpad_rsa | |
# In ephemeral environments like GitHub Action runners, relying on TOFU isn't providing any security | |
# so require the key obtained by `ssh-keyscan` to match the expected hash from https://help.launchpad.net/SSHFingerprints | |
ssh-keyscan git.launchpad.net >> ~/.ssh/known_hosts | |
ssh-keygen -qlF git.launchpad.net | grep -xF 'git.launchpad.net RSA SHA256:UNOzlP66WpDuEo34Wgs8mewypV0UzqHLsIFoqwe8dYo' | |
- name: Sync Release | |
run: ./snapcraft.yaml.sh -r${{ matrix.track }} -gnode${{ matrix.track }} | |
if: ${{ matrix.track != 'main' }} | |
- name: Sync Edge | |
run: ./snapcraft.yaml.sh -gmain | |
if: ${{ matrix.track == 'main' }} |