diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c877f6e..1c939eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,9 +8,11 @@ on: schedule: - cron: '0 0 * * *' +permissions: + contents: write + env: CARGO_TERM_COLOR: always - NIGHTLY_TOOLCHAIN_VERSION: ${{ secrets.NIGHTLY_TOOLCHAIN_VERSION }} jobs: build: @@ -27,13 +29,6 @@ jobs: - name: Remove binaries from cache run: rm -vfr target/wasm32-unknown-unknown/* - - name: Show specific nightly version - if: ${{ env.NIGHTLY_TOOLCHAIN_VERSION != '' }} - run: echo $NIGHTLY_TOOLCHAIN_VERSION | sed 's/-/ - /g' - - - name: Install specific nightly toolchain - run: make init - - name: Check fmt run: make fmt @@ -65,12 +60,10 @@ jobs: uses: actions/download-artifact@v3 - name: Delete previous release - uses: dev-drprasad/delete-tag-and-release@v0.2.1 + uses: dev-drprasad/delete-tag-and-release@v1.0.1 with: - delete_release: true tag_name: build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} - name: Rename binaries run: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 143b7ee..470b146 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,6 +6,10 @@ on: push: branches: [master] +permissions: + id-token: write + pages: write + env: CARGO_TERM_COLOR: always @@ -16,27 +20,33 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install nightly toolchain - uses: dtolnay/rust-toolchain@nightly - with: - targets: wasm32-unknown-unknown - - name: Cache uses: Swatinem/rust-cache@v2 - name: Test doc examples + if: github.event_name == 'pull_request' + env: + __GEAR_WASM_BUILDER_NO_BUILD: 1 run: cargo test --doc --workspace - name: Build docs - run: > - RUSTDOCFLAGS="--enable-index-page -Zunstable-options" + env: + RUSTDOCFLAGS: --enable-index-page -Zunstable-options + __GEAR_WASM_BUILDER_NO_BUILD: 1 + run: | cargo doc --no-deps --workspace - - name: Deploy + rm -f target/doc/.lock + + - name: Setup GitHub Pages if: github.event_name == 'push' - uses: peaceiris/actions-gh-pages@v3 + uses: actions/configure-pages@v3 + + - name: Upload Pages artifact + if: github.event_name == 'push' + uses: actions/upload-pages-artifact@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/doc - force_orphan: true - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' + path: target/doc + + - name: Deploy to GitHub Pages + if: github.event_name == 'push' + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11ad2fb..decabbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,11 @@ on: push: tags: ['*'] +permissions: + contents: write + env: CARGO_TERM_COLOR: always - NIGHTLY_TOOLCHAIN_VERSION: ${{ secrets.NIGHTLY_TOOLCHAIN_VERSION }} jobs: prepare: @@ -24,7 +26,6 @@ jobs: build: name: Build - needs: prepare runs-on: ubuntu-latest steps: - name: Checkout @@ -36,13 +37,6 @@ jobs: - name: Remove binaries from cache run: rm -vfr target/wasm32-unknown-unknown/* - - name: Show specific nightly version - if: ${{ env.NIGHTLY_TOOLCHAIN_VERSION != '' }} - run: echo $NIGHTLY_TOOLCHAIN_VERSION | sed 's/-/ - /g' - - - name: Install specific nightly toolchain - run: make init - - name: Build run: make build @@ -55,7 +49,7 @@ jobs: publish: name: Publish binaries - needs: build + needs: [prepare, build] runs-on: ubuntu-latest steps: - name: Checkout @@ -87,8 +81,16 @@ jobs: fi done + - name: Prepare release notes + run: | + awk '(/^## \[[0-9]+\.[0-9]+\.[0-9]+\]/ || /^\[Unreleased\]/) && STATE=="show" { exit } + STATE=="show"; + /^## \[${{ needs.prepare.outputs.version }}\]/ { STATE="show" }' CHANGELOG.md \ + | awk 'NF { SHOW=1 } SHOW' > RELEASE_NOTES.md + cat RELEASE_NOTES.md + - name: Publish uses: softprops/action-gh-release@v1 with: files: artifact/** - body_path: CHANGELOG.md # TODO: Cut piece related to the current version only + body_path: RELEASE_NOTES.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9cda7da --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.2] - 2023-07-26 + +### Changed + +- Updated Gear dependencies to rev `946ac47`. + +## [0.1.1] - 2023-05-29 + +### Changed + +- Updated Gear dependencies to rev `78dfa07`. + +[Unreleased]: https://github.com/gear-foundation/dapps-workshop-tamagotchi/compare/0.1.2...HEAD +[0.1.2]: https://github.com/gear-foundation/dapps-workshop-tamagotchi/compare/0.1.1...0.1.2 +[0.1.1]: https://github.com/gear-foundation/dapps-workshop-tamagotchi/compare/ca271c7...0.1.1