chore: Prepare for the 0.11.0 release #36
Workflow file for this run
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: Continuous Deployment | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
publish-github: | |
name: Publish on GitHub | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
TARGET: [x86_64-unknown-linux-gnu] | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@master | |
- name: Set the release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
--no-install-recommends \ | |
--allow-unauthenticated libgpgme-dev \ | |
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{matrix.TARGET}} | |
- name: Build | |
run: cargo build --release --locked --target ${{matrix.TARGET}} | |
- name: Prepare release assets | |
run: | | |
mkdir -p release/{man,completions} | |
cp {LICENSE,README.md,CHANGELOG.md} release/ | |
cp man/{gpg-tui.1,gpg-tui.toml.5} release/man/ | |
cp target/${{matrix.TARGET}}/release/gpg-tui release/ && strip -s release/gpg-tui | |
OUT_DIR=release/completions/ cargo run --release --bin gpg-tui-completions | |
mv release/ gpg-tui-${{env.RELEASE_VERSION}}/ | |
- name: Create release artifacts | |
run: | | |
tar -czvf gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz \ | |
gpg-tui-${{env.RELEASE_VERSION}}/ | |
sha512sum gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz \ | |
> gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz.sha512 | |
- name: Sign the release | |
run: | | |
echo "${{secrets.GPG_RELEASE_KEY}}" | base64 --decode > private.key | |
echo "${{secrets.GPG_PASSPHRASE}}" | gpg --pinentry-mode=loopback \ | |
--passphrase-fd 0 --import private.key | |
echo "${{secrets.GPG_PASSPHRASE}}" | gpg --pinentry-mode=loopback \ | |
--passphrase-fd 0 --detach-sign \ | |
gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz | |
- name: Prepare the release note | |
run: echo -e "$image\n$text" > RELEASE.txt | |
env: | |
image: '<a href="https://github.com/orhun/gpg-tui"><img src="assets/logo.jpg" width="600"></a>' | |
text: "See [**CHANGELOG.md**](./CHANGELOG.md) for release notes." | |
- name: Upload the release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: RELEASE.txt | |
files: | | |
gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz | |
gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz.sig | |
gpg-tui-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz.sha512 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
publish-crates-io: | |
name: Publish on crates.io | |
needs: publish-github | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@master | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
--no-install-recommends \ | |
--allow-unauthenticated libgpgme-dev \ | |
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-unknown-linux-gnu | |
- name: Publish | |
run: cargo publish --locked --token ${{ secrets.CARGO_TOKEN }} |