sapling/.github/workflows/sapling-cli-ubuntu-22.04-release.yml
Saul Gutierrez cfbb68aa62 ci: change versioning scheme (#208)
Summary:
Stack created with [Sapling]
* __->__ https://github.com/facebook/sapling/issues/208

[sl] ci: change versioning scheme

This changes our versioning scheme to `VERSION-%Y%m%d-%H%M%S-HASH`, where `VERSION` is defined in the VERSION file, `%Y%m%d-%H%M%S` is the current date, hour, minutes, and seconds, and `HASH` is the hash of the current commit.

Pull Request resolved: https://github.com/facebook/sapling/pull/208

Test Plan: Tested on my personal account

Reviewed By: bolinfest

Differential Revision: D41418387

Pulled By: sggutier

fbshipit-source-id: f89bce7cc842c6ca77c3a8330565fa19d41e39cc
2022-11-18 21:09:29 -08:00

59 lines
1.8 KiB
YAML

name: Release - Ubuntu 22.04
'on':
workflow_dispatch: null
push:
tags:
- v*
- test-release-*
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ format('ghcr.io/{0}/build_ubuntu_22_04:latest', github.repository) }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: rustup
run: rustup default stable
- name: set-env DEB_UPSTREAM_VERSION
shell: bash
run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV
- name: set-env SAPLING_VERSION
shell: bash
run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV
- name: Create .deb
working-directory: ./eden/scm
run: ${{ format('VERSION={0} make deb', env.DEB_UPSTREAM_VERSION) }}
- name: Rename .deb
working-directory: ./eden/scm
run: ${{ format('mv sapling_{0}_amd64.deb sapling_{0}_amd64.Ubuntu22.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ubuntu-22.04
path: ./eden/scm/sapling_*.deb
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Grant Access
run: git config --global --add safe.directory "$PWD"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: ubuntu-22.04
- name: Create pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh bash ci/create-release.sh $(ci/tag-name.sh)
- name: Upload Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) sapling_*.deb