Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
atc0005 committed Jan 13, 2024
1 parent 8db2e0c commit eaa464b
Showing 1 changed file with 74 additions and 74 deletions.
148 changes: 74 additions & 74 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
timeout-minutes: 5
# https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
version: ${{ steps.git-describe-semver-approach1.outputs.version }}
version: ${{ steps.git-describe-semver-approach5.outputs.version }}

steps:
- name: Print Docker version
Expand All @@ -53,74 +53,74 @@ jobs:
# https://github.com/choffmeister/git-describe-semver/issues/8
# https://github.com/choffmeister/git-describe-semver/blob/v0.3.11/action.yaml
# https://github.com/choffmeister/git-describe-semver/blob/v0.4.0/action.yaml
- name: Record semantic version using git-describe-semver (approach 1)
id: git-describe-semver-approach1
uses: choffmeister/git-describe-semver@v0.4.0 # version of action
with:
fallback: v0.0.0
drop-prefix: false
prerelease-prefix: dev
prerelease-suffix: ""
prerelease-timestamped: false
version: v0.3.11 # version of tool
# - name: Record semantic version using git-describe-semver (approach 1)
# id: git-describe-semver-approach1
# uses: choffmeister/git-describe-semver@v0.4.0 # version of action
# with:
# fallback: v0.0.0
# drop-prefix: false
# prerelease-prefix: dev
# prerelease-suffix: ""
# prerelease-timestamped: false
# version: v0.3.11 # version of tool

# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-setting-an-output-parameter
# https://stackoverflow.com/questions/59954185/github-action-split-long-command-into-multiple-lines
# https://github.com/actions/runner/issues/808
# https://github.com/moby/moby/issues/37366
- name: Record semantic version using git-describe-semver (approach 2)
id: git-describe-semver-approach2
run: |
echo -n "version=" >> "$GITHUB_OUTPUT"
docker container run \
--platform linux/amd64 \
--rm \
-t \
-v $PWD:/code \
-w /code \
ghcr.io/choffmeister/git-describe-semver:0.3.11 \
--fallback 'v0.0.0' \
--drop-prefix=false \
--prerelease-prefix 'dev' \
--prerelease-suffix "" \
--prerelease-timestamped=false \
| tr -d '\r' >> "$GITHUB_OUTPUT"
# - name: Record semantic version using git-describe-semver (approach 2)
# id: git-describe-semver-approach2
# run: |
# echo -n "version=" >> "$GITHUB_OUTPUT"
# docker container run \
# --platform linux/amd64 \
# --rm \
# -t \
# -v $PWD:/code \
# -w /code \
# ghcr.io/choffmeister/git-describe-semver:0.3.11 \
# --fallback 'v0.0.0' \
# --drop-prefix=false \
# --prerelease-prefix 'dev' \
# --prerelease-suffix "" \
# --prerelease-timestamped=false \
# | tr -d '\r' >> "$GITHUB_OUTPUT"

# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-setting-an-output-parameter
# https://stackoverflow.com/questions/59954185/github-action-split-long-command-into-multiple-lines
# https://github.com/actions/runner/issues/808
# https://github.com/moby/moby/issues/37366
- name: Record semantic version using git-describe-semver (approach 3)
id: git-describe-semver-approach3
run: >-
echo "version=$(
docker container run
--platform linux/amd64
--rm
-t
-v $PWD:/code
-w /code
ghcr.io/choffmeister/git-describe-semver:0.3.11
--fallback 'v0.0.0'
--drop-prefix=false
--prerelease-prefix 'dev'
--prerelease-suffix ""
--prerelease-timestamped=false
| tr -d '\r'
)" >> "$GITHUB_OUTPUT"
- name: Record semantic version using git-describe-semver (approach 4)
id: git-describe-semver-approach4
run: |
go install github.com/choffmeister/git-describe-semver@v0.3.11
echo -n "version=" >> "$GITHUB_OUTPUT"
$HOME/go/bin/git-describe-semver \
--fallback 'v0.0.0' \
--drop-prefix=false \
--prerelease-prefix 'dev' \
--prerelease-suffix "" \
--prerelease-timestamped=false \
| tr -d '\r' >> "$GITHUB_OUTPUT"
# - name: Record semantic version using git-describe-semver (approach 3)
# id: git-describe-semver-approach3
# run: >-
# echo "version=$(
# docker container run
# --platform linux/amd64
# --rm
# -t
# -v $PWD:/code
# -w /code
# ghcr.io/choffmeister/git-describe-semver:0.3.11
# --fallback 'v0.0.0'
# --drop-prefix=false
# --prerelease-prefix 'dev'
# --prerelease-suffix ""
# --prerelease-timestamped=false
# | tr -d '\r'
# )" >> "$GITHUB_OUTPUT"

# - name: Record semantic version using git-describe-semver (approach 4)
# id: git-describe-semver-approach4
# run: |
# go install github.com/choffmeister/git-describe-semver@v0.3.11
# echo -n "version=" >> "$GITHUB_OUTPUT"
# $HOME/go/bin/git-describe-semver \
# --fallback 'v0.0.0' \
# --drop-prefix=false \
# --prerelease-prefix 'dev' \
# --prerelease-suffix "" \
# --prerelease-timestamped=false \
# | tr -d '\r' >> "$GITHUB_OUTPUT"

- name: Record semantic version using git-describe-semver (approach 5)
uses: docker://ghcr.io/choffmeister/git-describe-semver:0.3.11
Expand All @@ -135,21 +135,21 @@ jobs:
--format="version=<version>"
$GITHUB_OUTPUT
- name: Print semantic version generated by git-describe-semver-approach1
run: |
echo "${{ steps.git-describe-semver-approach1.outputs.version }}"
- name: Print semantic version generated by git-describe-semver-approach2
run: |
echo "${{ steps.git-describe-semver-approach2.outputs.version }}"
- name: Print semantic version generated by git-describe-semver-approach3
run: |
echo "${{ steps.git-describe-semver-approach3.outputs.version }}"
- name: Print semantic version generated by git-describe-semver-approach4
run: |
echo "${{ steps.git-describe-semver-approach4.outputs.version }}"
# - name: Print semantic version generated by git-describe-semver-approach1
# run: |
# echo "${{ steps.git-describe-semver-approach1.outputs.version }}"
#
# - name: Print semantic version generated by git-describe-semver-approach2
# run: |
# echo "${{ steps.git-describe-semver-approach2.outputs.version }}"
#
# - name: Print semantic version generated by git-describe-semver-approach3
# run: |
# echo "${{ steps.git-describe-semver-approach3.outputs.version }}"
#
# - name: Print semantic version generated by git-describe-semver-approach4
# run: |
# echo "${{ steps.git-describe-semver-approach4.outputs.version }}"

- name: Print semantic version generated by git-describe-semver-approach5
run: |
Expand Down

0 comments on commit eaa464b

Please sign in to comment.