Avoid using decimal comma on mahcines with different locale #742
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
name: Create a snapshot image | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 3 * * WED' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
TEST_RELEASE_PROCESS: false # Set to true if you wish to exercise github triggers without spending time creating real artefacts. | |
jobs: | |
mk_snapshot: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create snapshot | |
id: snapshot | |
run: | | |
if [[ "${TEST_RELEASE_PROCESS}" == true ]] | |
then | |
snapshot_path="snsdemo_snapshot_${{ matrix.os }}.test" | |
echo "Guess what. The file called test has test content. Miracles will never cease." > "$snapshot_path" | |
else | |
snapshot_path="snsdemo_snapshot_${{ matrix.os }}.tar.xz" | |
time bin/dfx-sns-demo-install --verbose | |
time bin/dfx-snapshot-stock-make --snapshot "$snapshot_path" --verbose | |
fi | |
echo "path=$snapshot_path" >> "$GITHUB_OUTPUT" | |
- name: Time snapshot start # See GitHub for the duration of this step. | |
if: ${{ env.TEST_RELEASE_PROCESS != 'true' }} | |
run: bin/dfx-snapshot-restore --snapshot "${{ steps.snapshot.outputs.path }}" | |
- name: "Verify that the stock state behaves as expected" | |
id: test | |
run: bin/dfx-stock-test | |
- name: Stop dfx | |
run: dfx stop | |
- name: Tag if run on a schedule | |
if: ${{ (github.event_name == 'schedule') || (github.ref_name == 'snapshot-schedule') }} | |
id: tag | |
run: | | |
set -euxo pipefail | |
tag_name="$(date +release-%Y-%m-%d)" | |
if git show-ref --tags --verify --quiet "refs/tags/${tag_name}"; | |
then | |
echo "There is already a tag for today's release: ${tag_name}" | |
else | |
echo "Tagging as '${tag_name}'" | |
git tag "${tag_name}" | |
git push origin "refs/tags/${tag_name}" | |
fi | |
- name: Release | |
uses: ./.github/actions/release | |
with: | |
artefacts: ${{ steps.snapshot.outputs.path }} |