feat(slsa): Making SLSA installation optional #26
Workflow file for this run
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] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: Test crane-installer Action | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
slsa: [true, false] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install SLSA verifier | |
uses: slsa-framework/slsa-verifier/actions/installer@v2.0.1 | |
if: matrix.slsa && runner.os == 'Linux' # doesn't work on Windows or macOS | |
- name: Install crane | |
uses: ./ | |
- name: Test crane | |
run: crane version | |
main: | |
if: ${{ github.event_name == 'push' }} | |
name: Publish new version | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Bump version tag | |
id: tag | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update shared tags | |
run: | | |
MAJOR=$(echo ${{ steps.tag.outputs.new_version }} | cut -d . -f 1) | |
MINOR=$(echo ${{ steps.tag.outputs.new_version }} | cut -d . -f 2) | |
git tag -f v$MAJOR | |
git tag -f v$MAJOR.$MINOR | |
git push -f -u origin v$MAJOR | |
git push -f -u origin v$MAJOR.$MINOR |