Skip to content

Commit

Permalink
Add publish GH Action
Browse files Browse the repository at this point in the history
  • Loading branch information
pfreitag authored Aug 15, 2022
1 parent f486eca commit e1eee2b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish

on:
push:
# Publish `v1.2.3` tags as releases.
tags:
- v*


jobs:
publish:
runs-on: ubuntu-latest
container:
image: ghcr.io/foundeo/cfml-ci-tools/cfml-ci-tools:latest
steps:
- uses: actions/checkout@v2

- name: Set Version
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo $VERSION
box bump version=$VERSION
cat box.json
echo $VERSION > ./version.txt
env:
BOX_CONFIG_ENDPOINTS_FORGEBOX_APITOKEN: ${{ secrets.BOX_CONFIG_ENDPOINTS_FORGEBOX_APITOKEN }}

0 comments on commit e1eee2b

Please sign in to comment.