Skip to content

Release wstd 0.6.3 (#106) #22

Release wstd 0.6.3 (#106)

Release wstd 0.6.3 (#106) #22

Workflow file for this run

# Publication half of the release process for this repository. This runs on
# pushes to `main` and will detect a magical string in commit messages. When
# found a tag will be created, pushed, and then everything is published.
name: Publish Artifacts
on:
push:
branches: [main]
permissions:
contents: write
id-token: write
jobs:
create_tag:
name: Publish artifacts of build
runs-on: ubuntu-latest
environment: release
if: |
github.repository_owner == 'bytecodealliance'
&& github.event_name == 'push'
&& github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- run: rustup update stable && rustup default stable
# If this is a push to `main` see if the push has an indicator saying that
# a tag should be made. If so create one and push it.
- name: Test if tag is needed
run: |
git log ${{ github.event.before }}...${{ github.event.after }} | tee main.log
version=$(./ci/print-current-version.sh)
echo "version: $version"
echo "version=$version" >> $GITHUB_OUTPUT
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
if grep -q "automatically-tag-and-release-this-commit" main.log; then
echo push-tag
echo "push_tag=yes" >> $GITHUB_OUTPUT
else
echo no-push-tag
echo "push_tag=no" >> $GITHUB_OUTPUT
fi
id: tag
- name: Push the tag
run: |
git_refs_url=$(jq .repository.git_refs_url $GITHUB_EVENT_PATH | tr -d '"' | sed 's/{\/sha}//g')
curl -iX POST $git_refs_url \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d @- << EOF
{
"ref": "refs/tags/v${{ steps.tag.outputs.version }}",
"sha": "${{ steps.tag.outputs.sha }}"
}
EOF
if: steps.tag.outputs.push_tag == 'yes'
- uses: softprops/action-gh-release@v1
if: steps.tag.outputs.push_tag == 'yes'
with:
tag_name: v${{ steps.tag.outputs.version }}
- uses: rust-lang/crates-io-auth-action@v1
id: auth
if: steps.tag.outputs.push_tag == 'yes'
- run: |
rm -rf main.log
rustc ci/publish.rs
./publish publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
if: steps.tag.outputs.push_tag == 'yes'