Skip to content

Release Automation

Release Automation #33

Workflow file for this run

name: release ubuntu
on:
# workflow_run:
# workflows: [test ubuntu]
# types:
# - completed
workflow_dispatch:
inputs:
ref:
description: 'Ref to build (branch, tag or SHA)'
required: false
default: 'master'
pull_request:
branches:
- master
# push:
# tags:
# - '*'
jobs:
build:
name: Build Sourcery for Ubuntu (latest)
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build.outputs.filename }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup Swift
uses: swift-actions/setup-swift@v1.26.0
with:
swift-version: "5.9.2"
- name: Build it
id: build
run: |
BUILD_DIR="${HOME}/build/"
swift build --disable-sandbox -c release --build-path $BUILD_DIR
mv "${BUILD_DIR}x86_64-unknown-linux-gnu/release/sourcery" "${BUILD_DIR}/sourcery"
UNAME=$(uname -m)
CODENAME=$(lsb_release -c -s)
DESCRIPTION=$(lsb_release -d -s | sed "s/ /-/g" | sed "s/./\L&/g")
SUFFIX=$DESCRIPTION-$CODENAME-$UNAME
TAG=2.1.4
FILENAME="sourcery-${TAG}-${SUFFIX}.tar.xz"
ls -la
tar -zcvf $FILENAME "${BUILD_DIR}/sourcery"
ls -la
echo "FILENAME=${FILENAME}" >> $GITHUB_OUTPUT
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: ${{ steps.build.outputs.FILENAME }}
path: "~/${{ steps.build.outputs.FILENAME }}"
retention-days: 5
#$GITHUB_REF_NAME
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
# - name: Set color
# id: random-color-generator
# run: echo "SELECTED_COLOR=green" >> $GITHUB_OUTPUT
# - name: Get color
# run: echo "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}"