Skip to content

production

production #31

Workflow file for this run

name: Deploy
on: deployment
jobs:
deploy:
if: github.event.deployment.environment == 'production'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: '${{ secrets.GAUGEBOT_GITHUB_TOKEN }}'
CI: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup git
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Build artifacts
run: |
./run.sh package
- name: Set Version env
run: |
cd artifacts
if [ -z "$version" ]; then
version=$(ls gauge-dotnet* | sed "s/\.[^\.]*$//" | sed "s/gauge-dotnet-//");
fi
echo "VERSION=$version" >> $GITHUB_ENV
- name: update
run: |
cd artifacts
artifacts=()
dir=`pwd`
for i in `ls`; do
artifacts+="$dir/$i "
done
cd ..
echo "---------------------------"
echo "Updating release v$VERSION"
echo "---------------------------"
echo -e "Gauge Dotnet v$VERSION\n\n" > desc.txt
release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" getgauge gauge-dotnet)
echo "$release_description" >> desc.txt
gh release create "v$VERSION" -F ./desc.txt $artifacts
- name: 'deployment success'
if: success()
uses: 'deliverybot/status@master'
with:
state: 'success'
token: '${{ secrets.GITHUB_TOKEN }}'
- name: 'deployment failure'
if: failure()
uses: 'deliverybot/status@master'
with:
state: 'failure'
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Update metadata in gauge-repository
run: |
git clone https://github.com/getgauge/gauge-repository.git
cd gauge-repository
python update_metadata.py dotnet $VERSION
commit_message=$(echo -e "Update dotnet to v$VERSION")
git commit -am "$commit_message"
git push "https://$GITHUB_ACTOR:[email protected]/getgauge/gauge-repository.git" master