2020-10-12 21:54:44 +02:00
|
|
|
name: Release new version
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: 'The version number to use'
|
|
|
|
default: '0.0.0.0'
|
|
|
|
# Input has to be provided for the workflow to run
|
|
|
|
required: true
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Validate version number
|
|
|
|
run: |
|
|
|
|
# validate version structure
|
|
|
|
bash -c '[[ ${{ github.event.inputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1'
|
|
|
|
# ensure version doesn't already exist
|
|
|
|
bash -c 'git rev-parse "v${{ github.event.inputs.version }}" >/dev/null 2>&1 && exit 2 || exit 0'
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2.3.3
|
2020-10-12 22:00:00 +02:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-10-12 21:54:44 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: sudo apt install nuget mono-complete make
|
|
|
|
- name: Update version number, and commit
|
|
|
|
run: |
|
2020-10-12 23:47:33 +02:00
|
|
|
git config --global user.name "Github Actions"
|
|
|
|
git config --global user.email "dyc3@users.noreply.github.com"
|
2020-10-12 21:54:44 +02:00
|
|
|
sed -ri "s/Version\(\"[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\"\)/Version\(\"${{ github.event.inputs.version }}\"\)/g" AssemblyInfo.cs
|
2020-10-12 23:47:33 +02:00
|
|
|
git commit -m "Update version" AssemblyInfo.cs
|
2020-10-12 21:54:44 +02:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2020-10-12 23:32:49 +02:00
|
|
|
nuget restore SteamAuth/SteamAuth/SteamAuth.sln
|
2020-10-12 21:54:44 +02:00
|
|
|
make
|
|
|
|
mv build steamguard-cli-v${{ github.event.inputs.version }}
|
|
|
|
tar -cf steamguard-cli-v${{ github.event.inputs.version }}.tar.gz steamguard-cli-v${{ github.event.inputs.version }}
|
|
|
|
- name: Tag and push version commit
|
|
|
|
run: |
|
|
|
|
git push origin master
|
|
|
|
git tag -a "v${{ github.event.inputs.version }}" -m "Release v${{ github.event.inputs.version }}"
|
|
|
|
git push origin "v${{ github.event.inputs.version }}"
|
|
|
|
- name: Upload Build Artifact
|
|
|
|
uses: actions/upload-artifact@v2.2.0
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: steamguard-cli-v${{ github.event.inputs.version }}.tar.gz
|
|
|
|
deb-package:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build]
|
|
|
|
steps:
|
2020-10-13 00:25:33 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2.3.3
|
2020-10-12 21:54:44 +02:00
|
|
|
- name: Download Build Artifact (tar)
|
|
|
|
uses: actions/download-artifact@v2.0.5
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
- run: |
|
|
|
|
tar -xf steamguard-cli-v${{ github.event.inputs.version }}.tar.gz
|
|
|
|
mv steamguard-cli-v${{ github.event.inputs.version }} build
|
|
|
|
bash package.sh
|
|
|
|
- name: Upload deb
|
|
|
|
uses: actions/upload-artifact@v2.2.0
|
|
|
|
with:
|
|
|
|
name: deb
|
|
|
|
path: steamguard-cli_${{ github.event.inputs.version }}-0.deb
|
|
|
|
# TODO: update AUR pkgbuild
|
|
|
|
draft:
|
2020-10-13 00:25:33 +02:00
|
|
|
# FIXME: the auto drafter doesn't work
|
2020-10-12 21:54:44 +02:00
|
|
|
needs: [build, deb-package]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download Build Artifact (tar)
|
|
|
|
uses: actions/download-artifact@v2.0.5
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
- name: Download Build Artifact (deb)
|
|
|
|
uses: actions/download-artifact@v2.0.5
|
|
|
|
with:
|
|
|
|
name: deb
|
|
|
|
- name: Release Drafter
|
|
|
|
uses: release-drafter/release-drafter@v5.11.0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
name: v${{ github.event.inputs.version }}
|
|
|
|
tag: v${{ github.event.inputs.version }}
|
|
|
|
version: ${{ github.event.inputs.version }}
|
|
|
|
publish: false
|