Skip to content

feat: add working-directory input #194

feat: add working-directory input

feat: add working-directory input #194

Workflow file for this run

name: Validate
on: pull_request_target
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run lint
# dog-food testing. Should not release here at all, cause it runs on a PR.
- name: semantic-release
id: semantic-test
uses: ./
with:
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'fooalpha',
'foobeta',
'next',
'next-major',
{ name: 'beta', prerelease: true },
{ name: 'alpha', prerelease: true },
]
dry-run: true
repository-url: https://github.com/codfish/semantic-release-action.git
extends: '@semantic-release/apm-config'
tag-format: 'ver${version}'
working-directory: .
additional-packages: |
['@semantic-release/apm', '@semantic-release/git']
plugins: |
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github', '@semantic-release/apm', '@semantic-release/git']
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# dog-food testing. Should not release here at all, cause it runs on a PR.
- name: semantic-release with no inputs
id: semantic
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: test output
if: steps.semantic.outputs.new-release-published == 'false'
run: |
echo "$OUTPUTS"
echo "should be false: $NEW_RELEASE_PUBLISHED"
echo "should be empty: $RELEASE_MAJOR"
echo "should be empty: $RELEASE_MINOR"
echo "should be empty: $RELEASE_PATCH"
env:
OUTPUTS: ${{ toJson(steps.semantic.outputs) }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: docker login
run: |
echo "$GCR_TOKEN" | docker login ghcr.io -u codfish --password-stdin
env:
GCR_TOKEN: ${{ secrets.GCR_TOKEN }}
# Dockerhub is auto synced with the repo, no need to explicitly deploy
- name: build and push branch docker image to GCR
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: ghcr.io/codfish/semantic-release-action:${{ github.head_ref }}