diff --git a/.github/workflows/dev-publish.yaml b/.github/workflows/dev-publish.yaml index d523584..7056e00 100644 --- a/.github/workflows/dev-publish.yaml +++ b/.github/workflows/dev-publish.yaml @@ -8,7 +8,7 @@ on: git-ref: description: git-ref version to build type: string - default: ref/tags/dev + default: refs/tags/dev jobs: @@ -17,8 +17,8 @@ jobs: runs-on: ubuntu-latest outputs: rust-version: ${{ steps.versions.outputs.rust-version }} - git-ref: ${{ steps.versions.outputs.git-ref }} - git-ref-short: ${{ steps.versions.outputs.git-ref-short }} + git-sha: ${{ steps.versions.outputs.git-sha }} + git-sha-short: ${{ steps.versions.outputs.git-sha-short }} git-date: ${{ steps.versions.outputs.git-date }} steps: - uses: actions/checkout@v6 @@ -28,10 +28,12 @@ jobs: set -euo pipefail echo "rust-version=$(yq -r '.toolchain.channel' rust-toolchain.toml)" | tee -a "${GITHUB_OUTPUT}" - git_ref=$(gh api repos/bytecodealliance/wasmtime/git/${{ inputs.git-ref || 'ref/tags/dev' }} --template '{{.object.sha}}') - git_date=$(gh api repos/bytecodealliance/wasmtime/commits/${git_ref} --template '{{.commit.committer.date}}') - echo "git-ref=${git_ref}" | tee -a "${GITHUB_OUTPUT}" - echo "git-ref-short=${git_ref:0:7}" | tee -a "${GITHUB_OUTPUT}" + + git_commit=$(gh api repos/bytecodealliance/wasmtime/commits/${{ inputs.git-ref || 'refs/tags/dev' }} --template '{{.sha}} {{.commit.committer.date}}') + git_sha="$(echo "${git_commit}" | cut -d' ' -f1)" + git_date="$(echo "${git_commit}" | cut -d' ' -f2)" + echo "git-sha=${git_sha}" | tee -a "${GITHUB_OUTPUT}" + echo "git-sha-short=${git_sha:0:7}" | tee -a "${GITHUB_OUTPUT}" echo "git-date=${git_date:0:10}" | tee -a "${GITHUB_OUTPUT}" env: GH_TOKEN: ${{ github.token }} @@ -45,12 +47,11 @@ jobs: uses: ./.github/workflows/publish.yaml with: rust-version: "${{ needs.preflight.outputs.rust-version }}" - wasmtime-source: git - wasmtime-version: ${{ needs.preflight.outputs.git-ref }} + wasmtime-git-sha: ${{ needs.preflight.outputs.git-sha }} repository: dev - tag: dev-${{ needs.preflight.outputs.git-ref }} + tag: dev-${{ needs.preflight.outputs.git-sha }} additional-tags: | - dev-${{ needs.preflight.outputs.git-ref-short }} + dev-${{ needs.preflight.outputs.git-sha-short }} dev-${{ needs.preflight.outputs.git-date }} dev latest diff --git a/.github/workflows/manual-publish.yaml b/.github/workflows/manual-publish.yaml index 4039e3b..8eeff3e 100644 --- a/.github/workflows/manual-publish.yaml +++ b/.github/workflows/manual-publish.yaml @@ -3,18 +3,13 @@ name: Manual publish on: workflow_dispatch: inputs: - wasmtime-version: - description: wasmtime version to build - required: true + wasmtime-crate: + description: wasmtime crate version to build type: string - wasmtime-source: - description: wasmtime source. 'crate' or 'git' + wasmtime-git-ref: + description: wasmtime git ref to build ('refs/tag/{tag}', 'refs/heads/{branch}') required: true - type: choice - default: crate - options: - - crate - - git + type: string repository: description: image repository to publish into type: string @@ -37,6 +32,7 @@ jobs: runs-on: ubuntu-latest outputs: rust-version: ${{ steps.versions.outputs.rust-version }} + wasmtime-git-sha: ${{ steps.versions.outputs.wasmtime-git-sha }} additional-tags: ${{ steps.versions.outputs.additional-tags }} steps: - uses: actions/checkout@v6 @@ -46,10 +42,16 @@ jobs: set -euo pipefail echo "rust-version=$(yq -r '.toolchain.channel' rust-toolchain.toml)" | tee -a "${GITHUB_OUTPUT}" + + wasmtime_git_sha="$(gh api "repos/bytecodealliance/wasmtime/commits/${{ inputs.wasmtime-git-ref }}" --template '{{.sha}}'))" + echo "wasmtime-git-sha=${wasmtime_git_sha}" | tee -a "${GITHUB_OUTPUT}" + # convert space delimited to new-line delimited echo 'additional-tags<