You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git-secret/vendor/bats-core/.github/workflows/release.yml

66 lines
2.2 KiB
YAML

name: Release
on:
release: { types: [published] }
workflow_dispatch:
inputs:
version:
description: 'Version to simulate for deploy'
required: true
jobs:
version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
EXPECTED_VERSION=${{ github.event.inputs.version }}
EXPECTED_VERSION=${EXPECTED_VERSION:-${GITHUB_REF/refs\/tags\//}}
echo "EXPECTED_VERSION=$EXPECTED_VERSION" >> $GITHUB_ENV
- name: Check tag version matches artifact versions
run: |
echo "Expected version: $EXPECTED_VERSION"
# use double negation to see the result unless we get a match
(./bin/bats --version | grep -F "$EXPECTED_VERSION") || (echo "Bats version check failed: "; ./bin/bats --version; exit -1)
(npm view . version | grep -F "$EXPECTED_VERSION") || (echo "npm version check failed: "; npm view . version; exit -1)
(grep '^Version:' 'contrib/rpm/bats.spec' | grep -F "$EXPECTED_VERSION") || (echo "debian package version check failed: "; grep '^Version:' 'contrib/rpm/bats.spec'; exit -1)
npmjs:
runs-on: ubuntu-latest
needs: version-check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: "https://registry.npmjs.org"
- run: npm publish --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
github-npm:
runs-on: ubuntu-latest
needs: version-check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: "https://npm.pkg.github.com"
- name: scope package name as required by GHPR
run: npm init -y --scope ${{ github.repository_owner }}
- run: npm publish --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dockerhub:
runs-on: ubuntu-latest
needs: version-check
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v1
with:
file: ./Dockerfile
platforms: linux/amd64
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: bats/bats:${GITHUB_REF/refs\/tags\//}