ci: remove checkout step from release jobs in main.yml #359
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: main | |
on: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
pull_request: | |
jobs: | |
build-matrix: | |
name: Matrix | |
uses: metanorma/ci/.github/workflows/build-sample-matrix.yml@main | |
with: | |
smoke: false | |
flavors-only: true | |
public-only: true | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- id: snapcraft | |
uses: snapcore/action-build@v1 | |
with: | |
path: snap | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: metanorma-snap | |
path: ${{ steps.snapcraft.outputs.snap }} | |
retention-days: 5 | |
info: | |
name: Info | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
steps: | |
- run: sudo apt update && sudo apt install -y snapd | |
- uses: actions/download-artifact@v4 | |
with: | |
name: metanorma-snap | |
path: ./snap | |
- run: sudo snap install snap/*.snap --devmode | |
- run: snap interfaces metanorma | |
- run: snap connections metanorma | |
test: | |
name: Test | |
needs: [build, build-matrix] | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.job }}-${{ matrix.flavor.id }}-${{ github.head_ref || github.ref_name }}' | |
cancel-in-progress: true | |
continue-on-error: ${{ matrix.flavor.experimental }} | |
strategy: | |
max-parallel: 5 | |
fail-fast: false | |
matrix: ${{ fromJson(needs.build-matrix.outputs.samples-matrix) }} | |
steps: | |
- run: sudo apt update && sudo apt install -y snapd | |
- uses: actions/download-artifact@v4 | |
with: | |
name: metanorma-snap | |
path: ./snap | |
- run: | | |
sudo snap install snap/*.snap --devmode | |
sudo snap connect metanorma:home :home | |
- name: Fetch samples (${{ matrix.flavor.id }}) | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
repository: metanorma/mn-samples-${{ matrix.flavor.id }} | |
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} | |
fetch-depth: 1 | |
- uses: actions-mn/site-gen@v1 | |
with: | |
agree-to-terms: true | |
release-edge: | |
if: github.ref == 'refs/heads/main' | |
name: Release edge | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: metanorma-snap | |
path: ./snap | |
- name: Push to snapcraft.io | |
env: | |
SNAPCRAFT_TOKEN: ${{ secrets.METANORMA_SNAPCRAFT_TOKEN }} | |
run: | | |
echo "${SNAPCRAFT_TOKEN}" > .snapcraft_token | |
snapcraft login --with .snapcraft_token | |
snapcraft upload --release=edge snap/*.snap | |
release-candidate: | |
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, 'pre') | |
name: Release candidate | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: metanorma-snap | |
path: ./snap | |
- name: Push to snapcraft.io | |
env: | |
SNAPCRAFT_TOKEN: ${{ secrets.METANORMA_SNAPCRAFT_TOKEN }} | |
run: | | |
echo "${SNAPCRAFT_TOKEN}" > .snapcraft_token | |
snapcraft login --with .snapcraft_token | |
snapcraft upload --release=candidate snap/*.snap | |
release-stable: | |
if: startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, 'pre') | |
name: Release stable | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: metanorma-snap | |
path: ./snap | |
- name: Push to snapcraft.io | |
env: | |
SNAPCRAFT_TOKEN: ${{ secrets.METANORMA_SNAPCRAFT_TOKEN }} | |
run: | | |
echo "${SNAPCRAFT_TOKEN}" > .snapcraft_token | |
snapcraft login --with .snapcraft_token | |
snapcraft upload --release=stable snap/*.snap |