build-screenshots-tarball #39
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
# This is a basic workflow to help you get started with Actions | |
name: build-screenshots-tarball | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "4.30" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
build-screenshots-branch: | |
description: "Branch to use for build-screenshots" | |
default: "4.30" | |
required: true | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'debug' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
env: | |
version: "${{ github.event.inputs.build-screenshots-branch }}" | |
checkout-path: "code" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Output details | |
run: | | |
echo "repo ${{ github.repository }}" | |
echo "workspace $GITHUB_WORKSPACE" | |
echo "sha $GITHUB_SHA" | |
- name: Get next version | |
uses: reecetech/version-increment@2024.4.1 | |
id: version | |
with: | |
scheme: semver | |
increment: patch | |
release_branch: "4.30" | |
- name: Output next version | |
run: echo "next version ${{ steps.version.outputs.patch-version }}" | |
- name: Set the release date | |
id: release-date | |
run: echo "RELEASE_DATE=$(date '+%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
- name: Output the release date | |
run: echo "release date ${{ steps.release-date.outputs.RELEASE_DATE }}" | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Checkout build-screenshots branch | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ env.checkout-path }} | |
ref: "${{ env.version }}" | |
# Runs a single command using runners shell | |
- name: Compress screenshots action step | |
uses: a7ul/tar-action@v1.1.0 | |
id: compress | |
with: | |
cwd: ${{ env.checkout-path }} | |
command: c | |
files: | | |
./images | |
README.md | |
outPath: build-screenshots.tar.gz | |
# Use the output from the compress step | |
- name: Get the compress output | |
run: echo "The output was ${{ steps.compress.outputs.done }}" | |
- name: release | |
uses: actions/create-release@v1 | |
id: create-release | |
with: | |
draft: false | |
prerelease: false | |
release_name: "v${{ env.RELEASE_VERSION }}" | |
tag_name: "${{ env.RELEASE_VERSION }}" | |
body: "Release ${{ env.RELEASE_VERSION }} ${{ env.RELEASE_DATE }}" | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
RELEASE_NAME: "build screenshots" | |
RELEASE_VERSION: ${{ env.version }} | |
RELEASE_DATE: ${{ steps.release-date.outputs.RELEASE_DATE }} | |
- name: upload release artifact | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
TARBALL: "build-screenshots-${{ env.version }}" | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./build-screenshots.tar.gz | |
asset_name: build-screenshots.tar.gz | |
asset_content_type: application/gzip | |